[PHP] str_word_count Broken?

2003-10-03 Thread Steven Walker
I ran into a strange problem this morning. Suddenly I am getting an 
error that str_word_count is undefined, even though it has been working 
for the past few months. Anyone know why this may be? Nothing in the my 
code has changed at all.

I did phpinfo() to check the server and it is running 4.2.2. I have a 
workaround for the time being, but it is very strange.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Include Bug?

2003-06-06 Thread Steven Walker
Hello,

I have found troubling behavior using include() that looks like a bug. 
When I specify an include file by a full path name versus a relative 
path, PHP acts as though it has included the file, but variable and 
constant definitions in the include file are not coming through. My 
server is running PHP 4.3.1.

Here is an example:

I created a file called 'include.php', with the following contents:
	?
		echo include.php opened br;	//should print -only- if included, 
right?
		$testVar = test succeeded!;
	?

Then I created 'test.php', with the following contents:
	?
		$testVar = not defined;	//include.php should redefine this as 'test 
succeeded!'
		//include(http://www.walkereffects.com/test/include.php;); // full 
path
		include(include.php); // relative path
		echo $testVar;
	?

Using the relative path version of include outputs:
include.php opened
test succeeded!
And using the full path results in:
include.php opened
not defined
This doesn't seem right! Any ideas how I can work around this?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

Re: [PHP] Include Bug?

2003-06-06 Thread Steven Walker
I get it... so instead I should use:

include(/usr/home/sites/www.walkereffects.com/web/test/include.php)

Thank you,

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
On Friday, June 6, 2003, at 10:08 AM, Rasmus Lerdorf wrote:

Uh, http://www.walkereffects.com/test/include.php is not a full path
name, that is a URL.  That will make an HTTP request to your web 
server
for /test/include.php which will of course get parsed by PHP and you 
will
only get the parsed output which means you won't see any variables or 
any
PHP tags at all for that matter.  This is doing exactly what you are
asking it to do.

-Rasmus

On Fri, 6 Jun 2003, Steven Walker wrote:

Hello,

I have found troubling behavior using include() that looks like a bug.
When I specify an include file by a full path name versus a relative
path, PHP acts as though it has included the file, but variable and
constant definitions in the include file are not coming through. My
server is running PHP 4.3.1.
Here is an example:

I created a file called 'include.php', with the following contents:
?
echo include.php opened br; //should print -only- if included,
right?
$testVar = test succeeded!;
?
Then I created 'test.php', with the following contents:
	?
		$testVar = not defined;	//include.php should redefine this as 
'test
succeeded!'
		//include(http://www.walkereffects.com/test/include.php;); // full
path
		include(include.php); // relative path
		echo $testVar;
	?

Using the relative path version of include outputs:
include.php opened
test succeeded!
And using the full path results in:
include.php opened
not defined
This doesn't seem right! Any ideas how I can work around this?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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


Re: [PHP] Include Bug?

2003-06-06 Thread Steven Walker
I would recommend using your .htaccess file, or ini_set, or something
else to set your include_path variable
Thanks Joel, that worked nicely.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Namespace like C++

2003-06-03 Thread Steven Walker
Hi,

I was wondering if there is a way in PHP to define namespaces (as in 
C++ or some similar scope classification technique). I didn't find any 
related documentation. Is it possible?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Classes vs. functions?

2003-06-03 Thread Steven Walker
Can someone please explain to me when is a class useful over a set of 
functions?
Almost always. Object oriented programming offers many many advantages 
(that I cannot get into depth on here). There are a few exceptions 
where you would not use classes, such as utility functions like max() 
and min() that would be used generically.

The most basic purpose of a class is to define your own 'type' of 
object. When you create a class you are encapsulating an 'idea' into a 
set of attributes and behaviors specific to that type.

Designing classes not only offers a great way of organizing code but 
inevitably forces you to think thoroughly about the logical separation 
of code and to refine more and more towards an idealized type with well 
defined and sensible behavior. Conversely non-object oriented 
programming tends to lack in clarity and intended usage, making it 
difficult and confusing to use, getting exponentially worse for complex 
problems.

Classes have methods (functions) that are designed to work specifically 
on members of that class or perform operations directly related to it. 
Plain functions, however, have a tendency to be vague and complicated 
by argument lists. Furthermore they are easier to be misused and can be 
prone to latent errors.

In the end, it's like driving a car: the engine is neatly hidden under 
the hood and you don't care or want to know about the internal workings 
of it. You just want to get in, turn the key and drive. Classes are no 
different... they provide a simplified user-friendly interface to 
complex things. It's luxury in programming :)

I would suggest getting some books to learn further, and just start 
using classes.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
On Monday, June 2, 2003, at 08:31 PM, Vijay Avarachen wrote:

I have been mostly using function in my php code, and lately I have 
been
curious about classes.  I have a vague idea of classes from  my C++ 
class
that I took a few years back.  Can someone please explain to me when 
is a
class useful over a set of functions?  I have seen very few code with
classes, so pretty much always stayed away from it.

Thanks,
Vijay Avarachen


--
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] Bizarre Assignment Issue

2003-02-21 Thread Steven Walker
I am experiencing some very odd behavior in my classes that I don't 
know how to work around. Apparently, PHP is getting my variables 
'confused' with each other and assigning/returning the wrong data.

My class design is as follows:

class TestClass
{
var $TestLog;
var $Data1;
var $Data2;

function TestClass()
{
$this-$Data1 = 234;
$this-$TestLog = HELLO;
$this-$Data2 = wehre;   
}

function Report()
{
return $this-$TestLog;
}
}
and this class is being used in the following manner:

$test = new TestClass;
echo $test-Report();
You would expect the output to read 'HELLO', but instead it reads 
'wehre'. I'm totally confused ¿¿??

Any ideas? Thank you!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
On Friday, February 21, 2003, at 01:32 PM, ML wrote:

I am unable to send emails, and there are no errors being generated or
populated in the $php_errormsg variable, since I enabled track errors 
in the
php.ini. So I have no idea why the mail send is failing. Am I supposed 
to
specify
a mail server to use for sending mail? My sendmail was setup 
automatically
in my Redhat Setup and I have not touched its configuration 
options...is
there something I need to change? The sendmail path that is shown in 
the
phpinfo() function display is correct. Any feedback would be greatly
appreciated. Thanks!

-M L



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



[PHP] Current URL is http or https?

2002-05-17 Thread Steven Walker

Hi,

I'm trying to find a way to determine whether a clients browser current 
url is prefixed by http or https. However, I cannot seem to find the 
right predefined variable to give me this information. Basically, I want 
the same thing that HTTP_REFERER provides, but for the _current_ page.

Any ideas?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Re: Current URL is http or https?

2002-05-17 Thread Steven Walker

Thanks! I got it:

$_SERVER['HTTPS'] == on

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


On Friday, May 17, 2002, at 01:09  PM, Philip Hallstrom wrote:

 I would guess you want $_SERVER[SERVER_PROTOCOL] which returns
 HTTP/1.1 for me and probably HTTPS... for https connections... also 
 if
 you're using apache I think it sets some SSL_* variables that exist only
 when using https.

 On Fri, 17 May 2002, Steven Walker wrote:

 Hi,

 I'm trying to find a way to determine whether a clients browser current
 url is prefixed by http or https. However, I cannot seem to find the
 right predefined variable to give me this information. Basically, I 
 want
 the same thing that HTTP_REFERER provides, but for the _current_ page.

 Any ideas?



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





[PHP] Accessing Variables by Name

2002-05-14 Thread Steven Walker

Hi,

I couldn't find this in the documentation or on marc... Is there a way 
to access a variable by name using a string value? For example:

$myvariable = 10;
$stringdata = myvariable;
$[$stringdata] == $myvariable;

Obviously the last line is invalid, but is there a way to do this? I 
know about associative arrays, but they do not solve my particular 
problem. TIA.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Multiple File Download

2002-05-09 Thread Steven Walker

Miguel,

Thanks for following up. I got the zip functions all working last night. 
I deconstructed a zip file created by ZipIt and was able to discover 
where the PHP class was going wrong. Basically, there is a segment 
called 'data descriptor' that was being written into the file without 
the proper bit flag set. I posted a brief message on the Zend site on 
the zip file article stating what I found.

I still have some testing to do to make sure this is all going to work 
out, but it looks very promising.

Thanks for offering your help!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Thursday, May 9, 2002, at 02:19  PM, Miguel Cruz wrote:

 Any luck? I started playing with it but then ran into the fact that we
 don't have the gz functions compiled into our PHP. Before I really dug 
 in,
 thought I'd check whether you got it working.

 miguel

 On Tue, 7 May 2002, Steven Walker wrote:

 Miguel,

 That is very nice of you! I found the zip class on the Zend website:
  http://www.zend.com/codex.php?id=696single=1

 and here is an article pertaining to zip file creation:
  http://www.zend.com/zend/spotlight/creating-zip-files3.php

 When I try to open the php created zip file with Stuffit Expander, I 
 get
 the following message:
  Unknown zip header format encountered. This operation cannot
 continue.

 However, Zipit opens the archive fine. If I resave the archive from
 Zipit, then Stuffit will read it without error. So far I have compared
 the two files (the one created by php, and the one saved from Zipit).
 The basic compressed data matches, but there definitely is a difference
 in header structures.

 I have downloaded the zip file format specs, but am still pulling my
 hair out trying to figure out what all the different parts are. I am 
 not
 accustomed to working with hex data, so that to is making it hard.

 I appreciate you taking the time to help! Thank you!


 On Tuesday, May 7, 2002, at 12:39  PM, Miguel Cruz wrote:

 Is it possible it's just a MIME type thing? Let me know how to find 
 the
 class you're using and I'll try to play with it this afternoon.

 miguel

 On Tue, 7 May 2002, Steven Walker wrote:
 You are right. I am testing this out now using a zip class I got
 through
 the Zend website. However, Stuffit Expander does not like the zip 
 files
 created by php. I am able to open the zip archive through Zipit just
 fine, and Stuffit Expander opens the Zipit files ok. So now I am 
 trying
 to figure out how to modify the php zip class to make a zip archive
 that
 Stuffit will read.

 Any thoughts?


 On Tuesday, May 7, 2002, at 11:39  AM, Miguel Cruz wrote:

 On Tue, 7 May 2002, Steven Walker wrote:
 Does anyone know a way to download multiple files with a php
 script? I
 have 26 software products that can be purchased individually and I
 want
 to make the download process easier. I have looked into dynamically
 creating zip files, but it is problematic for Mac users (which
 account
 for a large part of my user base).

 Are you sure it's a problem for your Mac users? Stuffit Expander,
 which
 has come with all Macs for a while now and which is pretty much an
 essential tool for everyone, handles zip files just fine.

 miguel


 --
 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] Multiple File Download

2002-05-07 Thread Steven Walker

Hi,

Does anyone know a way to download multiple files with a php script? I 
have 26 software products that can be purchased individually and I want 
to make the download process easier. I have looked into dynamically 
creating zip files, but it is problematic for Mac users (which account 
for a large part of my user base).

Thanks in advance!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Bad Email Addresses

2002-03-25 Thread Steven Walker

Hi,

I have PHP automated emails sent from my website. Does anybody know a 
good way to filter returned mail? What I want to do is extract the bad 
email addresses from returned mail and delete them from my database.

For now I have the return path sent to me, and I manually weed the bad 
ones out, but it's tedious and won't last in the long term.

Thanks,

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Readfile() Download Issues

2002-03-14 Thread Steven Walker

Hi,

I'm having trouble supporting Internet Explorer 5.5 and earlier versions 
in a PHP download script. People are reporting that the file comes out 
as 'download.htm'.

Here is the code in my download.php:

$len = filesize($file);
header(Content-type: application/zip);
header(Content-Length: $len);
header(Content-Disposition: attachment; filename=$filename);
readfile($file);

Other browsers appear to work fine. An thoughts?

Thanks,

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] header(Location:) problem with Netscape

2002-03-14 Thread Steven Walker

Jeff,

I just had this problem!

Using $PHP_SELF did not work with Netscape 4.7 for some reason. I was 
using it in form submissions and kept getting the error 'Method Not 
Allowed'. My fix was simple, I just hard coded the action url since.

If you really need $PHP_SELF, I don't know what the fix is. I also tried 
getenv(PHP_SELF) and $_SERVER[PHP_SELF] without any luck.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Thursday, March 14, 2002, at 10:29  AM, Jeff Bearer wrote:

 I'm working on a app that uses the header(Location) is the middle of
 the file, but since I'm using output buffering it shouldn't matter.  The
 application works fine in Mozilla, Konqueror, and IE, but not in
 Netscape 4 or 6.

 I don't get the error that the headers have already been written
 error, it just loads the page as if the header(Location:) was
 commented out.

 Some of my thoughts on the subject.  I'm redirecting to $PHP_SELF is
 Netscape trying to be extra smart and think it doesn't have to refresh?
 I'm using gzip compression in output buffering, maybe there is a
 situation where Netscape 4  6 may not use the gzip compression, hence
 causing the output buffering not to work correctly?  But if that was the
 case I should see the error about headers already been written.

 Any suggestions would be great, thanks.

 --
 Jeff Bearer, RHCE
 Webmaster
 PittsburghLIVE.com
 2002 EPpy Award, Best Online U.S. Newspaper


 --
 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] Referer Is Empty

2002-03-07 Thread Steven Walker

Hello,

I'm having trouble getting the referring url. I have tried:
$HTTP_REFERER
getenv(HTTP_REFERER);
$_SERVER[HTTP_REFERER];
... but they are all blank.

The referring page has a meta http-equiv=Refresh header. If the user 
waits for the page to automatically redirect, the referring url is 
empty. If on the other hand the user clicks the link to the new page, 
the referring url is fine. Is there a limitation here?

I'm familiar with using header(location..), but it doesn't allow a delay 
time to be specified. Any ideas?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] FYI Using Qmail PHP

2002-03-06 Thread Steven Walker

To whom it may concern,

I recently had an ordeal trying to get PHP generated email to work using 
with qmail. After switching web servers, suddenly my automated emails 
were not working, coming out blank or with mime attachments.

If anybody runs into the problem, the fix is quite simple (but obscure). 
Simply use single '\n' rather than '\r\n'. For some reason (I don't know 
why) qmail doesn't like the CRLF.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] inspiration needed on problem s

2002-03-03 Thread Steven Walker

I have often looked at problems and immediately thought that PHP is not 
capable of the solution, but then some discovery sheds light and 
suddenly many new things are possible. This fell into that category for 
me too :)

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Sunday, March 3, 2002, at 09:37  AM, Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 * and then Steven Walker declared
 Nick,

 If I understand the problem correctly, the form reset button doesn't
 work when the form is prefilled with POST data.

 To overcome this, I created reset button of type='submit' 
 value='Reset'.
 When loading the form page I test to see if submit=='Reset' or 
 'Submit'.
 If it equals 'Reset', then I clear all the data.

 Yep, that's what I ended up doing. Can't believe I didn't work that out
 on my own!

 Cheers Steven
 - --
 - ---
  www.explodingnet.com   |Projects, Forums and
 +Articles for website owners
 - -- Nick Wilson -- |and designers.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8gl9kHpvrrTa6L5oRAideAJ9TZIm0RFm9UQL7M9Q4JNcI9XGNygCaA3yK
 yRepNH1fZnkLyTU81w4kKZg=
 =T53I
 -END PGP SIGNATURE-

 --
 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: cursor focus

2002-03-03 Thread Steven Walker

If you -could- use Javascript, it looks something like this:
document.formName.textfieldName.focus()

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Sunday, March 3, 2002, at 12:55  PM, Markas wrote:

 Hi, PHP will do NOTHING with cursor position in your page, because it's
 running on server. Perhaps what you've read is generating some 
 Javascript
 (which actually places the cursor) with PHP...

 Hmmm, if you are not running Javascript, maybe an attribute TABINDEX, 
 which
 almost every html tag has, would help, but sorry if i'm mistaken, didnt
 check that...


 Ralph Jarvis [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED];
 I am not running Javascript, just PHP/HTML...
 THe particular script I am having problems with has several decision
 points
 and includes which I think is confusing the placement of the cursor


 Gaylen Fraley [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED];
 This is not a php question. It is a JavaScript issue.  You need to add
 this
 code to the bottom of your page:

 script
 document.forms[0].text_box_name.focus();
 /script

 --
 Gaylen
 PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/

 Ralph Jarvis [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED];
 This is really a newbie question, but here goes.

 I am running PHP4 with Apache on Redhat 6.2.

 I am sure I read this somewheres, but can't find it again. When I 
 open
 a
 webpage in a small password application that I wrote, the cursor is
 not
 on
 the first text box I need to fill in, I need to click on the text box
 to
 begin typing. How do I get the cursor to focus on this text box?

 Many thanks in advance

 Ralph










 --
 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] inspiration needed on problem s

2002-03-01 Thread Steven Walker

Nick,

If I understand the problem correctly, the form reset button doesn't
work when the form is prefilled with POST data.

To overcome this, I created reset button of type='submit' value='Reset'.
When loading the form page I test to see if submit=='Reset' or 'Submit'.
If it equals 'Reset', then I clear all the data.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, March 1, 2002, at 10:34  AM, Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all
 I'm all out of inspiration in finding an elegant solution to a little
 problem, hope you guys can lend a hand :-)

 I have a form thats values are object properties. The object is carried
 in the current session.

 As a result my reset button won't work as the object still exists and so
 does it's properties. How can I make it so that the reset destroys or
 resets the properties?

 Many thanks
 - --
 - ---
  www.explodingnet.com   |Projects, Forums and
 +Articles for website owners
 - -- Nick Wilson -- |and designers.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8f8mgHpvrrTa6L5oRAqZsAKCdaQkIQOgs1dTRbvHcfoEj9VYhiwCgk8r6
 xlWPCeA3HyvhBeEYikNxMLM=
 =itz4
 -END PGP SIGNATURE-

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


Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Email MIME Support?

2002-03-01 Thread Steven Walker

Hello,

I've just moved my website to a new server and sendmail is not working 
the same. My email messages (sent via mail()) are coming out blank or 
with mime attachments. To verify my sanity, I tested this same script on 
the old server and it came through fine. The new server seems to like 
only plain text emails with no headers.

Does mime support have to be enabled for sendmail?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] maximum string length

2002-02-27 Thread Steven Walker

It may be able to store 8MB, but each line can only hold 1024 
characters. I ran into this using a string variable to store the message 
body of an HTML email. If I did not put a '\n' at the end of each line, 
I would get random '!' placed through the sent email.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 27, 2002, at 07:55  AM, Bogdan Stancescu wrote:

 Generally more than you'll ever need :-)

 About 8 MB by default.

 Bogdan

 Kancha . wrote:

 What is the maximum number of characters a variable of
 type string can hold ?? Is there a restriction ??

 $x = adfafasfadfaf  

 what is the max number of characters $x can hold ??

 __
 Do You Yahoo!?
 Yahoo! Greetings - Send FREE e-cards for every occasion!
 http://greetings.yahoo.com





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




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




Re: [PHP] Form Annoyances

2002-02-27 Thread Steven Walker

James,

Look into stripslashes():
http://www.php.net/manual/en/function.stripslashes.php

and htmlspecialchars():
http://www.php.net/manual/en/function.htmlspecialchars.php

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 27, 2002, at 11:08  AM, James Taylor wrote:

 I'm having this one issue that's really bugging me - I have a textarea 
 where
 you can type in something - After typing it in, it goes to another page
 asking you to verify, if it's correct, it inserts it into a database.

 The page that asks you to verify holds the value of the textbox in a 
 hidden
 form field.  If the value the user entered in contains any single (') or
 double () quotes, it will mess everything up.  Single quotes end up 
 having a
 backslash thrown automatically in front of it, and it inserts it into 
 the
 database WITH THE backslash.  If there are double quotes, the HTML will 
 get
 messed up due to the fact that when it sees the quote, it will cut off 
 the
 rest of the value because if:

 value=this is an example: Hello how are you. 

 everything after example: is going to get cut off.

 I tried putting the value in a query string, but when traveling across 
 two
 pages, it seems to do the exact same thing.

 Any suggestions?

 --
 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] writing files with php

2002-02-25 Thread Steven Walker

Try:
SITE CHMOD 666 filename

Also be sure that the file name in PHP matches the exact file name on 
disk.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Monday, February 25, 2002, at 12:36  AM, Sven Jacobs wrote:

 Hey

 How can I create files with php, I've tried somethings but php always 
 tells
 me that I don't have access.
 But the Directory has 777 access and the owner is my webserver.
 Can somebody help me :-)
 I need this for to create logfiles

 Greetings
 Sven




Re: [PHP] Fetching the values from previous page

2002-02-25 Thread Steven Walker

Dear Batara,

There are global variables that serve this purpose. You must have 
register_globals turned on:

http://www.php.net/manual/en/language.variables.predefined.php
$_POST
An associative array of variables passed to the current script via the 
HTTP POST method. Automatically global in any scope. Introduced in PHP 
4.1.0.

I believe that you can also use getenv() if the register_globals is not 
on.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Monday, February 25, 2002, at 09:48  AM, Batara Kesuma wrote:

 Hi all,

 I have a page that post a lot of variables to the next page. It looks
 like:

 form action=next_page.php
 input type=text name=f_text1
 input type=text name=f_text2

 select name=f_multiple1[] multiple size=6
 option value=1one
 option value=2two
 option value=3three
 /select

 input type=submit
 /form

 On next.php I can access all the values through: $f_text1, $f_text2, and
 an array $f_multiple1. My question is, how can I pack all of these
 variables from previous page _without_knowing_ the variables name? I 
 mean,
 I know I can write:

 $array = array(text1 = $f_text1, text2 = $f_text2, multiple1 =
 array($multiple1));

 But that is not what I want, it is more like:
 GetAllFromPrevious();

 or in Perl:
 %params = $q-Vars;

 And poof, all the values from previous will be inserted into an array.

 Thanks,
 --bk

 --
 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] HTML Email Has Random '!'

2002-02-25 Thread Steven Walker

Thanks Martin,
That was indeed the problem! I simply added a '\n' to the end of each 
line. And since html doesn't recognize it, it does no harm to the 
formatting.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


On Sunday, February 24, 2002, at 06:26  PM, Martin Towell wrote:

 it's to do with the length of a line - I think it's 1024 - if a lines 
 longer
 than that, an ! is put there and a new line is made

 Martin

 -Original Message-
 From: Steven Walker [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 25, 2002 1:18 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] HTML Email Has Random '!'


 Hi,

 Has anybody every had problems with random characters showing up in HTML
 email messages?

 I've set up an auto-responding email system for product purchasing and
 registration. The system sends multipart HTML and plain text messages
 using mail(). However, exclamation points are showing up in random
 places. I have no idea where they come from... over and over I've looked
 at my source code but can't find any correlation.

 For example, here's a clip from an email message:
 Support:
 If you need any assistance, or would like to arrange another method of
 delivery, please conta! ct:

 And the code that generates this text looks like:
 $email_html .= /b/fontfont face=\Verdana, Arial, Helvetica,
 sans-serif\ size=\2\ color=\#33\;
 $email_html .= If you need any assistance, or would like to arrange
 another method ofbrdelivery, please contact:;
 $email_html .= /font/ppa
 href=\mailto:[EMAIL PROTECTED]\;;

 Sorry this is so hard to read... but the point is that the '!' is not in
 my code. When I make subtle changes to the code, the '!' shows up in
 other places.



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




Re: [PHP] problem while loop.

2002-02-24 Thread Steven Walker

Jeff,

The problem is most likely with incrementing $event_data. It's hard to 
say without seeing the rest of the code.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

 I have a problem while loop that isn't terminating when it's supposed
 to.  I can't figure out what the problem is, if I run a comparison
 inside the while loop it matches as it should, but for some reason the
 same comparison isn't working as the while loop expression. I get an
 infinite loop when I run this code.

 while(strtotime($event_date) = strtotime($end_date)){
   # test to see if the loop should of stopped.
   if(strtotime($event_date) = strtotime($end_date))
   echo GO!!\n;
   else echo STOP!!!\n;

   /* omitted code that finds the next $event_date */
 }




 --
 Jeff Bearer, RHCE
 Webmaster
 PittsburghLIVE.com
 2002 EPpy Award, Best Online U.S. Newspaper

 --
 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] Email Verification

2002-02-24 Thread Steven Walker

Does anybody know any good ways (or available code) for verifying email 
addresses?

Checking syntax is not enough.. I'd like to actually be able to test 
whether the email address exists.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Re: Email Verification

2002-02-24 Thread Steven Walker

Michael,

Thanks for your help! Your advice entirely makes sense. Perhaps a good 
way to use email verification is to alert the user that the address 
could not be verified, but if they insist, they can still submit it.

This probably falls under the 90/10 rule... I'll spend 90% of my time 
trying to fix a problem that occurs 10% (or less) of the time ;)

Thanks for the Zend referral. I'll give it a try.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Sunday, February 24, 2002, at 11:31  AM, Michael Kimsal wrote:

 Steven Walker wrote:
 Does anybody know any good ways (or available code) for verifying 
 email addresses?
 Checking syntax is not enough.. I'd like to actually be able to test 
 whether the email address exists.


 Nothing is 100%, so don't exclude people because you can't verify them.

 There are 2 types of email addresse:

 verifiable
 unverifiable

 The 'type' is determined by talking to the mail host of the domain, but 
 this is, at best, an inexact science.

 Verifiable means that you've connected to the mail host and indicated 
 you had mail for a specific user account and it did not reply back 
 'user unknown'.  That is the best you can hope for, because once that 
 mail system accepts it for delivery, it may still not be delivered to 
 the end user for a number of reasons - no mailbox space left, for 
 example.  Or in fact, the specific user account DOESN'T exist, but the 
 mail server is set to accept all incoming mail first, and does more 
 precise error checking at a later time.

 Unverifiable would mean that the mail server will actually tell you up 
 front that an account doesn't exist, or isn't accepting mail from you, 
 or has a full mailbox, or whatever.

 So you might be able to tell if an account specifically DOES NOT exist, 
 but you can never be certain that an account actually does exist 
 without completely sending a mail, and hoping that it'll bounce to the 
 right place if there's a problem.

 The way to do this is to use SMTP to talk to the other mail host - Zend 
 has some code snippets like the one referenced below (probably others, 
 but here's a starting point)

 http://www.zend.com/codex.php?id=449single=1

 Hope that helps some...




 -- 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] problem while loop.

2002-02-24 Thread Steven Walker

Jeff,

Everything you are doing sounds fine, and I don't see any logic problems 
with the while loop. However, I really can't extrapolate any further 
conclusion without more info. How are you determining that the if 
statement is working? As long as this loop is running it should always 
echo 'GO!!'.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


On Sunday, February 24, 2002, at 03:00  PM, Jeff Bearer wrote:

 It's all returning proper dates and the proper timestamps when I check
 them inside the loop.  I'm formatting the dates in -MM-DD format and
 strtotime is returning the proper timestamps.  I'm curious how can you
 say it's a problem with the dates when the if statement comparing the
 same expression as the while loop works properly?



 On Sun, 2002-02-24 at 13:09, Steven Walker wrote:
 Jeff,

 The problem is most likely with incrementing $event_data. It's hard to
 say without seeing the rest of the code.


 I have a problem while loop that isn't terminating when it's supposed
 to.  I can't figure out what the problem is, if I run a comparison
 inside the while loop it matches as it should, but for some reason the
 same comparison isn't working as the while loop expression. I get an
 infinite loop when I run this code.

 while(strtotime($event_date) = strtotime($end_date)){
 # test to see if the loop should of stopped.
 if(strtotime($event_date) = strtotime($end_date))
 echo GO!!\n;
 else echo STOP!!!\n;

 /* omitted code that finds the next $event_date */
 }




 --
 Jeff Bearer, RHCE
 Webmaster
 PittsburghLIVE.com
 2002 EPpy Award, Best Online U.S. Newspaper

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



 --
 Jeff Bearer, RHCE
 Webmaster
 PittsburghLIVE.com
 2002 EPpy Award, Best Online U.S. Newspaper

 --
 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] HTML Email Has Random '!'

2002-02-24 Thread Steven Walker

Hi,

Has anybody every had problems with random characters showing up in HTML 
email messages?

I've set up an auto-responding email system for product purchasing and 
registration. The system sends multipart HTML and plain text messages 
using mail(). However, exclamation points are showing up in random 
places. I have no idea where they come from... over and over I've looked 
at my source code but can't find any correlation.

For example, here's a clip from an email message:
Support:
If you need any assistance, or would like to arrange another method of
delivery, please conta! ct:

And the code that generates this text looks like:
$email_html .= /b/fontfont face=\Verdana, Arial, Helvetica, 
sans-serif\ size=\2\ color=\#33\;
$email_html .= If you need any assistance, or would like to arrange 
another method ofbrdelivery, please contact:;
$email_html .= /font/ppa 
href=\mailto:[EMAIL PROTECTED]\;;

Sorry this is so hard to read... but the point is that the '!' is not in 
my code. When I make subtle changes to the code, the '!' shows up in 
other places.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]



Re: [PHP] adding 'vote' mechanism

2002-02-23 Thread Steven Walker

I personally prefer voting mechanisms that display how many votes have 
been cast. If you keep the thumbs_up separate from thumbs_down, you can 
figure the total number of votes. Otherwise, you will not be able to 
know whether the author is *really* average or just never voted for.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Saturday, February 23, 2002, at 11:45  AM, Erik Price wrote:


 On Saturday, February 23, 2002, at 02:42  PM, Nick Wilson wrote:
 I'd like to add a simple 'thumbs up, thumbs down' vote mechanism to it.
 The (simplified) table looks like this:

 id | authId | title | tip


 The only way I've come up with so far is to add two more fields
 (thumbs_up and thumbs_down). Then

 each time someone votes...
 get the current value of the field (say thumbs_up)
 use php to increment it's value and
 pop it back in the db.

 What if you made the field a signed INT field, and used PHP to subtract 
 one from the current value of the field every time someone chose 
 thumbs down or add one to the current value of the field every time 
 someone chose thumbs up.  This way you could have a level of how 
 well the author stacks up.

 This is just another idea shooting the moon, the truth is that it would 
 probably be fine either way.  A matter of personal preference.

 Erik





 

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


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




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




Re: [PHP] Re: how to build an array

2002-02-22 Thread Steven Walker

Also, for adding items onto an array use array_push()

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 22, 2002, at 07:41  PM, Jim Winstead wrote:

 Jtjohnston [EMAIL PROTECTED] wrote:
 Where/How do I start in building a new array? .= doesn't work:

 $authors .= explode(;, $mydata-KW);

 '.=' doesn't work because that does a string append.

 you just want:

   $authors = explode(;, $mydata-KW);

 then you can sort the array using sort(). http://php.net/sort

 jim

 --
 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] Reading the value in a cookie

2002-02-20 Thread Steven Walker

Brandon,

There are a few things about cookies that are not completely. I may be 
wrong about this, but this is what I've found:

• When a cookie is set, it must be passed before any other headers or 
tags. But the cookie is not actually available to the page it was set 
on. If the user reloads the page, or goes to another link, the cookie 
can then be read.

• When you put setcookie() in a PHP file, the cookie will be created 
every time the page is loaded. This will overwrite any previous cookie 
info stored. To overcome this, you can use conditional statements that 
test for the cookie. Just be sure that any code before setcookie does 
not create output (ie echo).

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 10:04  AM, Brandon Orther wrote:

 Hello,

 I know how to set a cookie.  How do I read the value of that cookie the
 next time that person returns to my website?

 
 Brandon Orther
 WebIntellects Design/Development Manager [EMAIL PROTECTED]
 800-994-6364
 www.webintellects.com
 




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




[PHP] getenv $REMOTE_ADDR

2002-02-20 Thread Steven Walker

Does anybody know why the predefined variable $REMOTE_ADDR would be 
null, while getenv(REMOTE_ADDR) works fine?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] getenv $REMOTE_ADDR

2002-02-20 Thread Steven Walker

What is the difference between $_SERVER and getenv()? Why should one be 
more reliable/better than the other?

 Better: avoid globals and use $_SERVER['REMOTE_ADDR'].

Sorry, if I'm asking you to repeat yourself... the documentation doesn't 
relate the two.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Hyperlinks vs Buttons

2002-02-20 Thread Steven Walker

Is there a way to regular hyperlinked text to submit a form?

For example, rather than having a button that says [Login], I just want 
underlined text: Login

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]



Re: [PHP] Hyperlinks vs Buttons

2002-02-20 Thread Steven Walker

Thanks for the replies.. one of these methods should work. I'm not 
targeting the general public, so it's ok my site requires a modern 
browser. Web development sure would a lot more fun without all the 
compatibility issues!!! ;P

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

 You can use JavaScript on that link. An onClick event
 which triggers document.formname.submit() would work,
 but then you lose backward compatibility (and thus
 accessibility) with non-JavaScript browsers.
 
 input type=image src=somegraphic.jpg


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




Re: [PHP] Need help

2002-02-20 Thread Steven Walker

John,

You could create a function to do this. Just think of it in small steps. 
You can use the string replace function to replace certain parts with 
other characters, or nothing at all. For example:

$data = Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) 
Henry;;
$new_data = str_replace(,(i) , \t, $data);

You can then use explode() to put it into an array. You'll have to 
figure out the details, but that should get you started.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 06:01  PM, jtjohnston wrote:

 Yeeesch! I neet help.

 I need a method to flush out lists of authors in a MySQL field called
 KW.

 The field looks a bit like this:
 


 1; Caribbean and West Indies; Guyana;4; Birney,(i) Earle; Harris,(i)
 Wilson; Hope,(i) Alec Derwent; King,(i) Bruce; James,(i) Henry;
 Olson,(i) Charles; Rushdie,(i) Salman; Purdy,(i) Al; Joyce,(i) James;
 Macleish,(i) Archibald; Cummings,(i) Edward Estlin (E.E.); Auden,(i) W.
 H.; Atwood,(i) Margaret; Tutuola,(i) Amos; Simon,(i) Claude;7;
 comparison of authors and works;
 


 In the section that starts with 4
 I need to look for (i) search backward to the prewious ; and search
 forward to the next ; and extract into an array the contents between the
 semi-colons to arrive at something that looks like:

 Birney, Earle
 Harris, Wilson
 Hope, Alec Derwent
 King, Bruce
 James, Henry
 Olson, Charles
 Rushdie, Salman
 Purdy, Al
 Joyce, James
 Macleish, Archibald
 Cummings, Edward Estlin (E.E.)
 Auden, W. H.
 Atwood, Margaret
 Tutuola, Amos
 Simon, Claude

 Can someone please help me get started?

 John


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





Re: [PHP] text box truncate

2002-02-20 Thread Steven Walker

How about wordwrap()?
http://www.php.net/manual/en/function.wordwrap.php

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 06:02  PM, Michael P. Carel wrote:

 Hi there,

 I have here a problem regarding how to truncate the data that was 
 written in
 the text box form? I want the data to be displayed in the html collumn 
 in
 standard length and format. Setting the  text box in WRAP will not 
 solve the
 problem it will not add a new line. I want that instead of wrapping it 
 will
 just add a newline(\n) to display it properly in the html column.

 Any idea? Please help me im stuck here.



 Regards,
 mike


 --
 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] wordwrap not working

2002-02-20 Thread Steven Walker

This may be a nl2br() problem. If you are setting \n as your newline 
character, it probably needs to be br if your just echoing it. 
Depending on where it ultimately gets displayed, you'll want one or the 
other. For example, sending an email message you want \n.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 07:25  PM, Michael P. Carel wrote:


 Hi,

 Im testing the example in the
 http://www.php.net/manual/en/function.wordwrap.php and it seems not 
 working
 it still printing the whole word and not wrapping. Im using php4.05 in 
 my
 redhat 6.2 using an apache.
 Here's the sample:
 ?
 $text = The quick brown fox jumped over the lazy dog.;
 $newtext = wordwrap( $text, 20 );

 echo $newtext\n;
 ?

 it should print like this:

 The quick brown fox
 jumped over the lazy dog.

 but it still printing like this:

 The quick brown fox jumped over the lazy dog.



 Please help



 Regards,
 Mike



 --
 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] Trouble with Sessions

2002-02-20 Thread Steven Walker

Phillip,

I had the same problem. It's even worse in IE5 since no error was 
displayed, just an empty form. To circumvent this, I put PHP controls 
for navigating. To go back, a button called 'modify' resubmits the data 
to the form page. On my site, if the user clicks the back button, they 
get hosed what can you do?

Any one else know?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 07:36  PM, Phillip S. Baker wrote:

 Hey All,

 I just converted my login process to sessions.
 It works great.

 However I am having one annoying issue come up.

 The site is a secure site. So each page has an include to check to see 
 if a validated session is there. If not a login forma appears and so on.
 It all works just fine.

 However I am coming up against a problem with forms now.

 I have a searchable listing of members.
 So there is a form to search for particular members.
 I preform the search, get a listing of possible matches.

 Now I click on a member name to get more info about him bringing up 
 another page.
 If I hit the back button on the browser to get the search results again 
 I get the following message

 Warning: Page has Expired The page you requested was created using 
 information you submitted in a form. This page is no longer available. 
 As a security precaution, Internet Explorer does not automatically 
 resubmit your information for you.

 To resubmit your information and view this Web page, click the Refresh 
 button.

 Under my previous scheme where login was through the use of cookies.
 I did not get the above message.

 Anyone have any ideas how to get ride of this message and just allow 
 the back button to work like it did before?

 (Oh I get similiar messages in NN 6.2 or NN 4.+)

 Phillip


 -- 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] getting the right REMOTE_ADDR

2002-02-20 Thread Steven Walker

I don't know too much about this, but IP checking is not a reliable way 
of identification anyway. Depending on how people connect to the 
internet, some people will have different IPs every time. Since I use a 
cable modem, my IP address rarely changes (if ever) so I use it as a 
safety net to prevent other users from accessing my files.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 08:28  PM, [EMAIL PROTECTED] 
wrote:

 Hi all,

 I need to know the exact ip of who is entering a site and I'm worried 
 about proxies and spoofing.  From php.net:
 http://www.php.net/manual/en/function.getenv.php
 This was listed:
 
 This gives you the right ip:

 if (getenv(HTTP_CLIENT_IP)){
 $ip=getenv(HTTP_CLIENT_IP);
 }
 else {
 $ip=getenv(REMOTE_ADDR);
 }
 
 Is this really a fool-proof method of knowing exactly what the ip is 
 that's getting onboard?

 Thanks!

 Sean


 ---
I N T E R C O N N E C T
   Internet Image Development
Tel: 505 989 3749
  http://www.InterConnect.is.it
 ---



 --
 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] getting the right REMOTE_ADDR

2002-02-20 Thread Steven Walker

You lost me... but it sounds like fun! :) BTW, can anything fake 
$HTTP_REFERER?

I'm sure one of the pros on the list can answer your original question:

Is this really a fool-proof method of knowing exactly what the ip is

if (getenv(HTTP_CLIENT_IP)){
$ip=getenv(HTTP_CLIENT_IP);
}
else {
$ip=getenv(REMOTE_ADDR);
}


Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 20, 2002, at 10:56  PM, [EMAIL PROTECTED] 
wrote:

 My problem is a touch different, I know the IP's of the visitors who 
 can visit the site, but I need to make sure that it's *really* them.  
 Cookies are a potential solution, but don't quite fit the bill due to 
 some variables on the users sides - and what I'm really keeping out are 
 bots (that break in), not people.
 I've tested for:
 $HTTP_CONNECTION (Keep-Alive means not a robot - right?)
 $HTTP_REFERER (can't fake this if you're a robot...?)
 $HTTP_ACCEPT_LANGUAGE (Only comes along with browsers... yea?)

 In short, I need to make sure that only humans (who are on the IP list) 
 can view content... and I wanted to make sure that bots couldn't spoof 
 their IP and look like one of the human IP's.

 make sense?

  thanks,
 Sean

 -Original Message-
 From: Steven Walker [mailto:[EMAIL PROTECTED]]

 I don't know too much about this, but IP checking is not a reliable way
 of identification anyway. Depending on how people connect to the
 internet, some people will have different IPs every time. Since I use a
 cable modem, my IP address rarely changes (if ever) so I use it as a
 safety net to prevent other users from accessing my files.


 On Wednesday, February 20, 2002, at 08:28  PM, [EMAIL PROTECTED]
 wrote:

 Hi all,

 I need to know the exact ip of who is entering a site and I'm worried
 about proxies and spoofing.  From php.net:
 http://www.php.net/manual/en/function.getenv.php
 This was listed:
 
 This gives you the right ip:

 if (getenv(HTTP_CLIENT_IP)){
 $ip=getenv(HTTP_CLIENT_IP);
 }
 else {
 $ip=getenv(REMOTE_ADDR);
 }
 
 Is this really a fool-proof method of knowing exactly what the ip is
 that's getting onboard?

 Thanks!

 Sean


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




Re: [PHP] Re: Copyright

2002-02-19 Thread Steven Walker

Here is a good explanation, in laymen's terms, of intellectual property 
laws:

'An Intellectual Property Law Primer for Multimedia and Web Developers'
http://www.laderapress.com/lib/laderapress/primer.html

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Tuesday, February 19, 2002, at 05:40  AM, michael kimsal wrote:

 Dani wrote:
 Hi!
 I have seen lots of webiste with a sign [EMAIL PROTECTED] 2002 
 etc...
 if I would like to do that, do I have to register myself to a certain
 company or.. I just put it on my website?

 Depending on what country you are in, it would probably help to 
 register the information (or website code or whatever) with the 
 appropriate copyright agency in your government.  It will probably 
 never be used, but if and when you needed to bring charges against 
 someone for violating that copyright, it's registered.  If it's 
 unregistered, it's possibly harder to prove violation.  By registering 
 with your government , it essentially creates a verified copy with a 
 time/date as to when it was registered (not when it was created 
 necessarily, but when the government agency registered it).

 Hopefully you'll never need to use it, and most people don't bother 
 with registration.  If you think your content is valuable enough, then 
 by all means register with your government's copyright agency.  It may 
 save you a bundle in the future.

 In either case, you can still display the copyright mark immediately.





 -- 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] Parse Error Line Numbers

2002-02-19 Thread Steven Walker

Does anyone know how line numbers are figured? I get errors like the 
following:

Parse error: parse error in 
/home/sites/site104/users/walker/web/admin/_fileutils.php on line 74

Is PHP preprocessing the code to remove comments and white space? The 
larger my code file, the more inaccurate the parse error line number. In 
this case, the actual error was on line 83.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]



Re: [PHP] Parse Error Line Numbers

2002-02-19 Thread Steven Walker

 my take on it is that php reports the line it was on when it 
 encountered the error with isn't the same as where you've made your 
 mistake.
That sometimes is the case, depending on the error/omission. However, in 
my case the error is reported on a line number -before- the actual line 
number I found it on. I understand that compile/parse-time errors do not 
provide a lot of accuracy... I'm just trying to understand a little 
better how it generally preprocesses the file.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Tuesday, February 19, 2002, at 11:07  AM, Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 * and then Steven Walker declared
 Does anyone know how line numbers are figured? I get errors like the
 following:

 Parse error: parse error in
 /home/sites/site104/users/walker/web/admin/_fileutils.php on line 74

 Is PHP preprocessing the code to remove comments and white space? The
 larger my code file, the more inaccurate the parse error line number. 
 In
 this case, the actual error was on line 83.

 Well I hope someone provides a more technically accurate answer than
 mine :-) but my take on it is that php reports the line it was on when
 it encountered the error with isn't the same as where you've made your
 mistake.
 - --
 - ---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners
 - -- Nick Wilson --  |and designers.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8cqKJHpvrrTa6L5oRArJ8AJ4jXm+TYxKbXhqhtAgmgR14wycojACgh4zX
 vSFDxyu6sWvE7G14Jp91MZg=
 =P2dl
 -END PGP SIGNATURE-

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





[PHP] Mail Headers Formatting

2002-02-19 Thread Steven Walker

Can someone tell me where to find documentation on defining mail headers 
and formatting? I've been to faqs.org, but was hoping to find something 
a bit more friendly.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Mail Headers Formatting

2002-02-19 Thread Steven Walker

Nick,

Thank you for your reply. I have looked at the RFC's and they are just 
too wordy without examples. I was hoping to find a nice hyperlinked html 
page with complete docs and examples...that may be hoping for too much:).

I'll be using this to generate auto-responding email messages. I'd like 
to format them with the style of my website. I don't need too much, I 
just want to know what the capabilities are.

Another programmer on the list said he would send me some code, so that 
should be a good starting point.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Tuesday, February 19, 2002, at 02:08  PM, Nick Wilson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 * and then Steven Walker declared
 Can someone tell me where to find documentation on defining mail 
 headers
 and formatting? I've been to faqs.org, but was hoping to find something
 a bit more friendly.

 Hi Steve, thought I'd reply offlist as my answer isn't really so hot and
 I'm intereted to see what others say.

 You need to look at the RFC? the email standard in general to get info
 on headers, I suggest a google search on 'request for comments' I'm sure
 you'll find the right place.

 What is it you want to do?
 If you just want to add some common ones to the mail() comand you do it
 buy specifying the fourth parameter like this:

 $extra=Reply-To: [EMAIL PROTECTED];
 mail($to, $subj, $msg, $extra);

 HTH
 - --
 - ---
  www.explodingnet.com   |Projects, Forums and
 +Articles for website owners
 - -- Nick Wilson --  |and designers.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8cszQHpvrrTa6L5oRAkPzAJ9JzK+83hqYbDTrmFvU2RYUX8UksgCgljYz
 VKYLIO7w6YWU/ZEQS5MjiaE=
 =kNo8
 -END PGP SIGNATURE-




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




Re: [PHP] Difference between two dates

2002-02-19 Thread Steven Walker

You can convert the time into seconds using mktime(), subtract one from 
the other, and then reformat it using gmstrftime:

//int mktime ( int hour, int minute, int second, int month, int day, int 
year [, int is_dst])
//string gmstrftime ( string format [, int timestamp])
?
$time1 = mktime (0,0,0,12,32,1997);
$time2 = mktime (0,0,0,12,31,1995);
$dif = $time1 - $time2;
$new_time = gmstrftime(%b %d %Y, $dif);

echo $time1br;
echo $time2br;
echo $difbr;
echo $new_timebr;
?
The output looks like this:
883641600
820396800
63244800
Jan 03 1972

Of course you will have to get the date out of the current format you 
have it, but that shouldn't be too hard using explode() and implode();

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Tuesday, February 19, 2002, at 06:51  PM, Uma Shankari T. wrote:




  Hello,

  How can i find out the difference between two dates.

 I am having the date like this

 $str=10-01-2001;
 $str1=01-02-2002;

 I need to find out the difference between the date,month and year.

 If anyone know the solution for this problem plz tell me


 -Uma



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





[PHP] gzdoc

2002-02-19 Thread Steven Walker

Does anybody have experience using gzdoc? I can't find much information 
about it, and was just wondering if it is even worth the effort. For 
anyone interested, here is the url I found it at:
http://php.weblogs.com/http_compression

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Timed Redirect

2002-02-18 Thread Steven Walker

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

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

Thanks! 

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Timed Redirect

2002-02-18 Thread Steven Walker

Here's what I found:

This does not work:
 header(Location: http://www.google.com/;, 5);
 That would redirect you to www.google.com in 5 seconds.
According to the documentation, the second param is bool replace, for 
replacing header information.

This does work:
META HTTP-EQUIV=Refresh CONTENT=x;
URL=http://www.example.com/;

Thanks for the help.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]



[PHP] Unique Numbers

2002-02-18 Thread Steven Walker

Is it safe to use time() to generate a unique id number?

My thinking is that the call to the server will take enough time that no 
two users will  get the same time stamp (although they may be very 
close). Even though the likelyhood of  two users entering at the same 
time is very slim, I don't want to take the chance.

What about microtime()?

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Unique Numbers

2002-02-18 Thread Steven Walker

Thanks for the input. I just replaced time() with uniqid(), and I 
think that will work great.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Monday, February 18, 2002, at 01:38  PM, Lars Torben Wilson wrote:

 On Mon, 2002-02-18 at 13:14, Steven Walker wrote:
 Is it safe to use time() to generate a unique id number?

 My thinking is that the call to the server will take enough time that 
 no
 two users will  get the same time stamp (although they may be very
 close). Even though the likelyhood of  two users entering at the same
 time is very slim, I don't want to take the chance.

 What about microtime()?

 No, time functions suck for this. See uniqid() for this kind of thing:

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


 Cheers,

 Torben



 --
  Torben Wilson [EMAIL PROTECTED]
  http://www.thebuttlesschaps.com
  http://www.hybrid17.com
  http://www.inflatableeye.com
  +1.604.709.0506



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




Re: [PHP] form submission error trapping

2002-02-17 Thread Steven Walker

Jason,

I just finished one of my form pages, and I'm really happy with how it 
turned out.

I created one php page that both displays the form and validates the 
input. When the user hits the submit button, it submits the data to 
itself. If anything is missing from the page, the form is reshown with 
missing fields highlighted and the other fields filled in. If on the 
other hand the info passes the validation test, the information is shown 
to screen a new button (hidden form) allows the user to continue.

If you want, I can send you a link to my test site so you can check it 
out.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Sunday, February 17, 2002, at 02:22  PM, Jason Dulberg wrote:

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

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

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

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

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

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

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

 Any suggestions are greatly appreciated.

 __
 Jason Dulberg
 Extreme MTB
 http://extreme.nas.net


 --
 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] form submission error trapping

2002-02-17 Thread Steven Walker

 I guess the real challenge is converting a pre-existing page like the 
 one I've described into one that can re-populate itself on an error 
 condition.  Building it that way from scratch is merely a programming 
 task.

That's true, however there are a few ways to cheat :). For example, in 
my form I have a State and Country popup menu. Rather than trying to 
write code that selects the proper one to match the post data, I simply 
create a new entry at the top:

   select name=state
 ?
 if(isset($state)) {
$statename = GetStateName($state);
echo option selected value='$state'$statename;
 }
 ?
 option value=Select a state
 option value=ALAlabama

This works because I've already verified the data. If the data doesn't 
pass verification, it would be reset and would fail the isset($state) 
test.

Otherwise, most form elements are pretty easy to assign values to.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Sunday, February 17, 2002, at 03:42  PM, Ken wrote:


 -Original Message-
 From: Steven Walker [mailto:[EMAIL PROTECTED]]

 I created one php page that both displays the form and validates the
 input. When the user hits the submit button, it submits the data to
 itself. If anything is missing from the page, the form is reshown with
 missing fields highlighted and the other fields filled in. If on the
 other hand the info passes the validation test, the information is 
 shown
 to screen a new button (hidden form) allows the user to continue.

 Only catch is, you have to build all that logic to populate your 
 fields.  Piece of cake when you have a simple form, not so easy when 
 you have a dynamically-generated form (with a variable number of 
 inputs) including multi-select buttons and the like.

 I guess the real challenge is converting a pre-existing page like the 
 one I've described into one that can re-populate itself on an error 
 condition.  Building it that way from scratch is merely a programming 
 task.

 - Ken
 [EMAIL PROTECTED]





Re: [PHP] form submission error trapping

2002-02-17 Thread Steven Walker

Yeah, for buttons (radio/checkboxes) I had to put an if statement on 
each one:

   td width=84%
 input type=radio name=formatting value=unformatted
   ?
if($format == unformatted) echo checked;
   ?
 unformatted
 input type=radio name=formatting value=table
   ?
if($format == table) echo checked;
   ?

You're right... it's not as easy.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Empty form

2002-02-15 Thread Steven Walker

Ben,

I've been dealing with this problem recently. The solution I found works 
great in my case... the data processing page is the same as the form 
page.

When the page is loaded it tests for post data. If no data is available 
(ie !isset($name)), then the form will be displayed. When the user 
submits the form, it actually submits it to the same page ($PHP_SELF). 
This way, no matter how many times the user makes mistakes, your page 
will faithfully redisplay the form until they get it right. You can even 
build in special formatting, such as highlighting missing or incorrect 
fields.

When the post data is verified, the page can display the next page by 
using an include() or header() redirect, and bypass the form.

I hope this helps.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 15, 2002, at 12:24  AM, Ben Clumeck wrote:

 I am trying to have my form redirect back to my form, if the 'name' 
 field is
 not filled in or the submit button is not pushed.  Can someone tell me 
 what
 my problem is with the script below that I have in my header:

 ?
 if(!isset($name)||($HTTP_POST_VARS[submit]))
 {
 header(Location: form.htm);
 }
 ?

 Thanks,

 Ben


 --
 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] modular programming

2002-02-15 Thread Steven Walker

Dear Kunal,

I don't know of any papers... I'd be interested in what you find.

In my experience, 'modular coding' is entirely a process of evolution. 
It's impossible to sit down and design software on paper. Every piece of 
code I write is under constant evaluation. Each time a weakness is 
exposed, I rethink my strategy. Often there is no 'perfect' solution, 
since each presents a different set of compromises. Devoting yourself to 
endlessly rewriting and structuring your code will, in the long term, 
yield better code than anyone can advise in a book or paper.

Over modulation of code has drawbacks too. Sometimes the simple solution 
is the one to use, even if it means rewriting the same thing every once 
in a while. When people start creating classes and polymorphic 
interfaces to their code needlessly, performance is compromised.

Perhaps what you are looking for is also a reference for good 
programming practice. For C++, I really liked the books by Scott Meyers: 
'Effective C++', first and second edition. Here he sets out some 
fundamental 'guidelines' for coding. You may like to check it out, even 
thought it doesn't apply to PHP directly.

Of what it's worth, that's my two cents :) I'd be interested in what 
others think on this matter.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 15, 2002, at 08:24  PM, Kunal Jhunjhunwala wrote:

 hey,
 does anyone know of any good papers on modular programing? I have been 
 able
 to make my code modular, but I am not satisfied with it. I am trying to 
 make
 my program work the plug in way.. where i can just add more modules 
 on the
 fly... any tips? :)
 Regards,
 Kunal Jhunjhunwala

 Minds think with ideas, not information. No amount of data, bandwidth, 
 or
 processing power can substitute for inspired thought. - Clifford Stoll


 --
 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] character replace function

2002-02-14 Thread Steven Walker

You can also use the strtr() function:
$new_data = strtr($data, ', `);// replaces ' with `

Also keep in mind that you can use the chr($number) to return special 
ascii characters.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Thursday, February 14, 2002, at 10:48  AM, Aaron Gould wrote:

 Try:

 $outputstring = str_replace($character_to_erase, '', $inputstring);

 --
 Aaron Gould
 [EMAIL PROTECTED]
 Web Developer


 - Original Message -
 From: Phil Schwarzmann [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, February 14, 2002 1:38 PM
 Subject: [PHP] character replace function


 I need a function that will erase a particular character in a string.

 Any ideas?!?


 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




Re: [PHP] good practice

2002-02-14 Thread Steven Walker

I don't understand what you are trying to do...

If you need to verify whether the page has already been submitted to 
itself, you can test any of the form variables using isset(). For 
example:

?
if(isset($name)) {
$LoadedBefore = 1;
}
if(!$LoadedBefore) {
echo form name='form1' action='$PHP_SELF';
echo input type='text' name='name';
echo input type='submit' name='submitdata' value='submit';
}
?

You can also pass the data back into the form:
echo input type='text' name='$name'; // using $name variable as 
value

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Thursday, February 14, 2002, at 11:09  AM, James Taylor wrote:

 Can someone recommend a better method for doing something like the 
 following?
 All of my programs are written like this, but it's really poor form
 considering I'm not predeclaring my variables, etc.   Only thing I can 
 really
 think of is to assign a value in the form a number like 1 or something, 
 then
 do a if $value == 1 {do something} but that seems kinda hokey. Here's an
 example of something I'd do:


 HTMLBODY

 ?

if ($submitdata) {
   dosomething;
   exit;
 }

echo form name=\form\ action=\$PHP_SELF?\\n;
echo   input type=\text\ name=\data\\n;
echo   input type=\submit\ name=\submitdata\ value=\ Submit 
 \\n;
echo /form\n/body\n/html;

 ?

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

2002-02-14 Thread Steven Walker


On Thursday, February 14, 2002, at 11:06  AM, Andrey Hristov wrote:

 Maybe you can put a small iframe in the HTML which will refresh on some 
 basis (3secs for example), and in the HTML of this
 html you do the popup - window() or alert(). what you choose. the 
 message which is sent(from the peer1 to server) is stored in db
 (or file) but have to stored somewhere till it is sent to the end user.

 Best regards,
 Andrey Hristov
 - Original Message -
 From: James Taylor [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, February 14, 2002 9:02 PM
 Subject: [PHP] Sessions


 Speaking of sessions, I was wondering if something like this is even
 possible:  Users log on, each has their own unique session..  Is it 
 possible
 to do some sort of instant messaging deal with this?  Like, on the 
 main page
 is displays everyone that's logged on, then you maybe choose their 
 name from
 a form, type in a message, then a pop-up box appears with the message 
 to the
 user?

 I only know how to use sessions for authentication, something like 
 this I'd
 have no idea where to start.  If it is possible, could someone point 
 me in
 the right direction?

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


Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] File Access Security Issues

2002-02-14 Thread Steven Walker

How assured can I be that people will NOT be able to view my php code?

I'm creating an e-commerce site that will contain sensitive information 
and algorithms. I want to to take every precaution possible to protect 
that data and code.

One concern in particular is the ability to view the contents of a file 
through PHP, rather than through HTTP. I've noticed that many file 
functions do not work for non-local files, which is good. But can a good 
hacker still get access some indirect way?

Thank you!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




[PHP] Filling Forms with $variables

2002-02-13 Thread Steven Walker

Hi,

I'm having trouble setting the value of form elements using variable 
values. For example:

?$name = Steven Walker?
form name=form1 method=post action=infocollect.php
input type=text name=name value=?echo $name;?
/form

In the browser, the name field is only filled with Steven, and drops 
off everything after the space. If I echo $name outside of the form it 
prints fine.

Any help would be really appreciated. Thanks!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]



Re: [PHP] Filling Forms with $variables

2002-02-13 Thread Steven Walker

Adding quotes around the whole php statement works! I also tried the 
htmlspecialchars() function, but that did not work. It makes sense 
because after the preprocess of php, no quotes would be left... it's 
obvious now :)

Thank you

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Wednesday, February 13, 2002, at 02:05  PM, Christopher William 
Wesley wrote:

 On Wed, 13 Feb 2002, Steven Walker wrote:

 ?$name = Steven Walker?
 form name=form1 method=post action=infocollect.php
  input type=text name=name value=?echo $name;?
 /form

 In the browser, the name field is only filled with Steven, and drops
 off everything after the space. If I echo $name outside of the form it

 You need to put quotes around the value.
 value=?echo $name;??

   g.luck,
 ~Chris   /\
  \ / September 11, 2001
   X  We Are All New Yorkers
  / \ rm -rf /bin/laden




 --
 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] Form Data History

2002-02-11 Thread Steven Walker

Hi,

I'm having some problems with form data disappearing and wondered if 
anyone has experience with this.

On a secure server I'm using PHP to handle form data to collect personal 
information. If data is missing or incorrect, the user is alerted to 'go 
back'... but upon going back in history, all the data that was in the 
form is lost. This did not occur on my regular not-secure web server.

Does anyone know what may cause this?

Thank you!

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


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




Re: [PHP] Re: function? variable?

2002-02-11 Thread Steven Walker

Jason,

If I understand your question, you want to display the contents of a 
variable to screen? Try this:

 html
 head
 title/title
 /head
 body
 ?
   $test_variable = this is a test;
   echo Here is what it says: $test_variable;
 ?
 /body
 /html

Also note that you do not need to use the PHP tags twice:
echo ?witakr home?   //incorrect
echo wtakr home;  //correct

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Monday, February 11, 2002, at 09:34  PM, Jason Whitaker wrote:

 I just saw something with my code there.. i have my link tag inside the
 title tag.. i will have to fix that :)

 --

 Jason Whitaker


 Jason Whitaker [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 : Is there a way to set a variable or is there a function that takes the
 : information between the title tags and prints to the screen where you
 : command?
 :
 : ei:
 :
 : //head
 : //title
 : // ?php
 : // echo ?witakr home?
 : // ?
 : //
 : //LINK REL=stylesheet HREF=css/sCSS.css TYPE=text/css
 : ///title
 : ///head
 :
 : where as i would want the word home from the echo ?witakr home? 
 (or
 : what ever word that may be in place of the word home) to print to 
 say.. a
 : certain place in the body of the page?
 :
 :
 : Jason Whitaker
 :
 :



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