[PHP] Recommend an IDE for Windows

2004-05-07 Thread Chris Lott
I already use and am happy with a variety of text editors (vim, emacs,
ultraedit, jedit, Homesite) depending on my needs, but I would like
recommendations for a PHP specific IDE that will run on Windows XP.

Specifically I am looking for something that can help with debugging,
provides efficient code browsing (functions, objects, etc) across multiple
files in a project, easy browsing through proper mappings to a development
server/local server, and hooks to PHP reference/help/website.

Needless to say, standard features like syntax highlighting, block
formatting, etc. are a requirement.

I've been looking at Zend Studio and Nusphere PHPEd as primary candidates.
However, I have a short window to buy something (fiscal year issues) so any
comments on these two editors (separately or in comparison to one another)
or other tools I should be looking at would be greatly appreciated!

c
--
Chris Lott chris.lott[AT]gmail.com

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



[PHP] HTML vs. Plain Text Input

2004-05-07 Thread Matt Palermo
Hey, I was wondering if anyone knows of any easy ways to detect for HTML
input.  I have a textarea box that I want users to be able to input either
plain text or HTML code.  I will later display this input data, so if the
user input plain text then I will replace newline characters (\r\n, \n, \r)
with br tags, but if they input HTML code I don't want to format it before
displaying it.  Basically is there an easy way to detect HTML code in
inputs?  If you have any suggestions, please let me know.

Thanks,

Matt
http://sweetphp.com

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



Re: [PHP] Recommend an IDE for Windows

2004-05-07 Thread Richard Davey
Hello Chris,

Friday, May 7, 2004, 7:47:18 AM, you wrote:

CL I already use and am happy with a variety of text editors (vim, emacs,
CL ultraedit, jedit, Homesite) depending on my needs, but I would like
CL recommendations for a PHP specific IDE that will run on Windows XP.

CL Specifically I am looking for something that can help with debugging,
CL provides efficient code browsing (functions, objects, etc) across multiple
CL files in a project, easy browsing through proper mappings to a development
CL server/local server, and hooks to PHP reference/help/website.

CL Needless to say, standard features like syntax highlighting, block
CL formatting, etc. are a requirement.

Sounds like you just described Zend Studio perfectly. I used to use
the NuSphere PHPEd a few years back and quite frankly it was bugged to
hell - they have sorted out loads of those issues since then, but I
moved onto Zend Studio a year ago and won't ever look back. I have
been beta testing the 3.5.0 release for a while now and it's
absolutely great. The debugger is smart, the Code Profiler essential,
the code analyser is good too and the Project settings can span
whatever you need it to. I honestly couldn't code without it now.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] HTML vs. Plain Text Input

2004-05-07 Thread Richard Davey
Hello Matt,

Friday, May 7, 2004, 9:33:28 AM, you wrote:

MP Hey, I was wondering if anyone knows of any easy ways to detect for HTML
MP input.  I have a textarea box that I want users to be able to input either
MP plain text or HTML code.  I will later display this input data, so if the
MP user input plain text then I will replace newline characters (\r\n, \n, \r)
MP with br tags, but if they input HTML code I don't want to format it before
MP displaying it.  Basically is there an easy way to detect HTML code in
MP inputs?  If you have any suggestions, please let me know.

Just one way of doing this, but...

$userinput = 'blah blah bbold!/b blah';
$test_html = strip_tags($userinput);

if ($userinput !== $test_html)
{
   echo 'They included html!';
}
else
{
echo 'Plain text';
}

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Tristan . Pretty
To recap...
We have two servers:
1. USA - holds most of our databases, and E-mail. but specifically, the 
usernames and passwords, or all our users (Lotus Domino Server)
2. UK - Runs our website. (Unix Server)

We wanted to be able to allow people to login on on server 1, and getr 
authenticated etc, and then get redirected to server 2.
Using http_referer we would confirm that they came from server 1

However, as I discovered, that is not possible.
So what we did was this:

On the login form on server 1, the referering URL to server 2, contains a 
varibale called 'secure'
we asign that variable that value of '4654376534' and divide it by the day 
(eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide by 
7)
I know that this is crackable, but it's just a stop gap measure...

My problem today is this:
It's not confirming the values?
See my code below

session_start();
$today_day = date(d);
$code1 = ($today_day+1) * $secure;
$code2 = $today_day * $secure;
$code3 = ($today_day-1) * $secure;
$master_code = 4654376534;
if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 == 
$master_code)) {
$_SESSION[logged] = 'true';
$login_info = You are now bLogged in/b;
} else if ($_SESSION[logged] == 'true') {
$login_info = You are still bLogged in/b;
}
=

I start by getting the date $today_day
As we're in two time zones, I don't wanna get caught out by the time 
difference, so I've created a +/- 1 each side ($code1-3)
and fianlly, asigned the master input variable (the decoder)

Now it all works great..! (all variables echo what they should) however, 
I'm not getting logged in?
I'm really stumped...
any ideas?

Tris...

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP] auto saving data in forms

2004-05-07 Thread mserra
Hi,

i'm currently designing a website in which i have some forms with data saved in
database.

My customer wants that when he add or modify some datas in these forms, changes
will be made immediately in database. I really don't know how to do it and don't
know if it is possible. 

Is there anyone who have fijnd a solution to solve that problem and who can help
me. I accept solutions in other langages than PHP like JAVA + XML.

thanks,

Marc

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



[PHP] Showing only part of string

2004-05-07 Thread Dave Carrera
Hi List,

$string = This is a test string to titleSHOW ONLY THIS BIT/title of the
string;

I have tried strpos, str_replace and other string manipulation things but I
cant get my head around how to achieve showing the text with the
title/title tags of the string.

Any help is appreciated and I thank you in advance for any help given.

Thank you

Dave Carrera


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 04/05/2004
 

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



Re: [PHP] Showing only part of string

2004-05-07 Thread Richard Harb
I guess the easiest way to do this would be to use a regular
expression:

if (preg_match(/title(.*)\/title/i, $string, $m)) {
$found = $m[1];
}
echo $found;

Richard


Friday, May 7, 2004, 12:11:02 PM, thus was written:
 Hi List,

 $string = This is a test string to titleSHOW ONLY THIS BIT/title of the
 string;

 I have tried strpos, str_replace and other string manipulation things but I
 cant get my head around how to achieve showing the text with the
 title/title tags of the string.

 Any help is appreciated and I thank you in advance for any help given.

 Thank you

 Dave Carrera

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



Re: [PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Richard Harb
What about allowing your UK server to access the database of your USA
Server? You could open a port to that specific IP address only, ...

Then authenticating users on the UK server would work like a charm.
You could even create a 'shared' database for basic session
information.

I think if sessions are used the overhead would not be overly serious
except for the one time a user has to log in.

Ok, I have no idea whatsoever about how to access a Domino Server, but
there just has to be a way... XMLRPC?

just a thought ...
Richard


Friday, May 7, 2004, 11:39:12 AM, thus was written:
 To recap...
 We have two servers:
 1. USA - holds most of our databases, and E-mail. but specifically, the
 usernames and passwords, or all our users (Lotus Domino Server)
 2. UK - Runs our website. (Unix Server)

 We wanted to be able to allow people to login on on server 1, and getr
 authenticated etc, and then get redirected to server 2.
 Using http_referer we would confirm that they came from server 1

 However, as I discovered, that is not possible.
 So what we did was this:

 On the login form on server 1, the referering URL to server 2, contains a
 varibale called 'secure'
 we asign that variable that value of '4654376534' and divide it by the day
 (eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide by
 7)
 I know that this is crackable, but it's just a stop gap measure...

 My problem today is this:
 It's not confirming the values?
 See my code below
 
 session_start();
 $today_day = date(d);
 $code1 = ($today_day+1) * $secure;
 $code2 = $today_day * $secure;
 $code3 = ($today_day-1) * $secure;
 $master_code = 4654376534;
 if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 ==
 $master_code)) {
 $_SESSION[logged] = 'true';
 $login_info = You are now bLogged in/b;
 } else if ($_SESSION[logged] == 'true') {
 $login_info = You are still bLogged in/b;
 }
 =

 I start by getting the date $today_day
 As we're in two time zones, I don't wanna get caught out by the time
 difference, so I've created a +/- 1 each side ($code1-3)
 and fianlly, asigned the master input variable (the decoder)

 Now it all works great..! (all variables echo what they should) however,
 I'm not getting logged in?
 I'm really stumped...
 any ideas?

 Tris...

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



Re: [PHP] Showing only part of string

2004-05-07 Thread John W. Holmes
Dave Carrera wrote:

$string = This is a test string to titleSHOW ONLY THIS BIT/title of the
string;
I have tried strpos, str_replace and other string manipulation things but I
cant get my head around how to achieve showing the text with the
title/title tags of the string.
Any help is appreciated and I thank you in advance for any help given.
$b = strpos($str,'title')+7;
$l = strpos($str,'/title') - $b;
$m = substr($str,$b,$l);
Sure, you can use regular expressions, but there's not really a need 
unless this gets more complex. Even though you're executing more code 
with this solution, it'll be faster than preg_match() (go ahead and 
benchmark it).

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

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

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


RE: [PHP] Returning an object

2004-05-07 Thread Jay Blanchard
[snip]
Please don't reply if you really, really don't know what you are talking
about.
[/snip]

Talk about alienating yourself right up front.

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



RE: [PHP] auto saving data in forms

2004-05-07 Thread Jay Blanchard
[snip]
My customer wants that when he add or modify some datas in these forms,
changes
will be made immediately in database. I really don't know how to do it
and don't
know if it is possible. 

Is there anyone who have fijnd a solution to solve that problem and who
can help
me. I accept solutions in other langages than PHP like JAVA + XML.
[/snip]

PHP cannot because it is server side and the action needs to send data
from the client to the server. You might be able to use JavaScript and
have the data updated as each field loses focus. Seems rather
inefficient.

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



RE: [PHP] Showing only part of string

2004-05-07 Thread Dave Carrera
Thanks John,

Works a treat.

Thank You

Dave Carrera


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: 07 May 2004 12:32
To: Dave Carrera
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Showing only part of string


Dave Carrera wrote:

 $string = This is a test string to titleSHOW ONLY THIS BIT/title 
 of the string;
 
 I have tried strpos, str_replace and other string manipulation things 
 but I cant get my head around how to achieve showing the text with the 
 title/title tags of the string.
 
 Any help is appreciated and I thank you in advance for any help given.

 $b = strpos($str,'title')+7;
 $l = strpos($str,'/title') - $b;
 $m = substr($str,$b,$l);

Sure, you can use regular expressions, but there's not really a need 
unless this gets more complex. Even though you're executing more code 
with this solution, it'll be faster than preg_match() (go ahead and 
benchmark it).

-- 
---John Holmes...

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

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




---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 04/05/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 04/05/2004
 

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



Re: [PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Tristan . Pretty
I looked into getting PHP to talk to a  Lotus notes database, and was 
really really scared..!
I think this is my best bet, for now at least... however, my simple code 
does not work?
Wierd...
Any other ideas?




Richard Harb [EMAIL PROTECTED] 
07/05/2004 11:38
Please respond to
Richard Harb [EMAIL PROTECTED]


To
php-general [EMAIL PROTECTED]
cc

Subject
Re: [PHP] A work around my HTTP_REFERER Prob...






What about allowing your UK server to access the database of your USA
Server? You could open a port to that specific IP address only, ...

Then authenticating users on the UK server would work like a charm.
You could even create a 'shared' database for basic session
information.

I think if sessions are used the overhead would not be overly serious
except for the one time a user has to log in.

Ok, I have no idea whatsoever about how to access a Domino Server, but
there just has to be a way... XMLRPC?

just a thought ...
Richard


Friday, May 7, 2004, 11:39:12 AM, thus was written:
 To recap...
 We have two servers:
 1. USA - holds most of our databases, and E-mail. but specifically, the
 usernames and passwords, or all our users (Lotus Domino Server)
 2. UK - Runs our website. (Unix Server)

 We wanted to be able to allow people to login on on server 1, and getr
 authenticated etc, and then get redirected to server 2.
 Using http_referer we would confirm that they came from server 1

 However, as I discovered, that is not possible.
 So what we did was this:

 On the login form on server 1, the referering URL to server 2, contains 
a
 varibale called 'secure'
 we asign that variable that value of '4654376534' and divide it by the 
day
 (eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide 
by
 7)
 I know that this is crackable, but it's just a stop gap measure...

 My problem today is this:
 It's not confirming the values?
 See my code below
 
 session_start();
 $today_day = date(d);
 $code1 = ($today_day+1) * $secure;
 $code2 = $today_day * $secure;
 $code3 = ($today_day-1) * $secure;
 $master_code = 4654376534;
 if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 ==
 $master_code)) {
 $_SESSION[logged] = 'true';
 $login_info = You are now bLogged in/b;
 } else if ($_SESSION[logged] == 'true') {
 $login_info = You are still bLogged in/b;
 }
 =

 I start by getting the date $today_day
 As we're in two time zones, I don't wanna get caught out by the time
 difference, so I've created a +/- 1 each side ($code1-3)
 and fianlly, asigned the master input variable (the decoder)

 Now it all works great..! (all variables echo what they should) however,
 I'm not getting logged in?
 I'm really stumped...
 any ideas?

 Tris...

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





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP] Active PHP Sessions

2004-05-07 Thread Paul Higgins
Hi all,

I'm on a shared server, and I do not believe that I have access to the /tmp 
directory where the session files are stored (I believe that is how it works 
:).  I want to keep track of which sessions are active.  Basically, I just 
want a list of the active sessions for my site.

How can I do this?

Thanks!

_
Watch LIVE baseball games on your computer with MLB.TV, included with MSN 
Premium! 
http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/direct/01/

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


Re: [PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Jason Wong
On Friday 07 May 2004 20:05, [EMAIL PROTECTED] wrote:

  varibale called 'secure'
  we asign that variable that value of '4654376534' and divide it by the

 day

  (eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide

 by

  7)

That would result in a floating point number ...

  if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 ==
  $master_code)) {

... which does not lend easily to such comparisons.

If you're still intent on using this *ahem* 'security' scheme then I suggest 
you use multiplication instead (just make sure that the largest number you're 
processing is less than 2147483648 - or use the BCMath functions).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
After all, it is only the mediocre who are always at their best.
-- Jean Giraudoux
*/

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



Re: [PHP] Active PHP Sessions

2004-05-07 Thread Brent Clark
 I'm on a shared server, and I do not believe that I have access to the
/tmp
 directory where the session files are stored (I believe that is how it
works
 :).  I want to keep track of which sessions are active.  Basically, I just
 want a list of the active sessions for my site.

 How can I do this?

Hi
Are we talking about smb shares for linux.
If so, why dont you just ask your admin to create a share to /tmp

or create via php a web page that looks at /tmp and displayes the file.
Remember, there are many ways to skin  a cat.

Copied and pasted from za.php.net
?php
$dir = /tmp/;

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
   if ($dh = opendir($dir)) {
   while (($file = readdir($dh)) !== false) {
   echo filename: $file : filetype:  . filetype($dir . $file) .
\n;
   }
   closedir($dh);
   }
}
?

Kind Regards
Brent Clark

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



Re: [PHP] Active PHP Sessions

2004-05-07 Thread Jason Wong
On Friday 07 May 2004 20:32, Paul Higgins wrote:

 I'm on a shared server, and I do not believe that I have access to the /tmp
 directory where the session files are stored (I believe that is how it
 works

 :). 

Of course you have access to it. The webserver needs to be able to READ the 
session files that it writes and hence you're also able to access those files 
with PHP.

 I want to keep track of which sessions are active.  Basically, I just

 want a list of the active sessions for my site.

You would have to define what /you/ mean by an active session.

 How can I do this?

i) There is no way to determine which session files are for your site without 
actually examining their contents. 

ii) PHP does not store any site identification info in the session files.

iii) Hence you need to store a (hopefully) unique string in all your sessions 
then search for this string in the session files.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Phasers locked on target, Captain.
*/

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



Re: [PHP] Active PHP Sessions

2004-05-07 Thread John W. Holmes
From: Jason Wong [EMAIL PROTECTED]

 i) There is no way to determine which session files are for your site
without
 actually examining their contents.

 ii) PHP does not store any site identification info in the session files.

 iii) Hence you need to store a (hopefully) unique string in all your
sessions
 then search for this string in the session files.

You have the option of using session_save_path() and using a directory of
your own to store the session files. Then the active session count is just
a count of how many files exist in that directory. You have to implement
your own garbage cleanup of the session files, though.

---John Holmes...

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



[PHP] Re: Recommend an IDE for Windows

2004-05-07 Thread Seth Bembeneck
I use Maguma Studio, the free version:

http://www.maguma.com/products/?article=Studio

The differences between the versions:

http://www.maguma.com/products/?article=studio_compare

It does have a splash screen that asks if you want to buy a copy even though
its free.

Hope this helps

Seth
Chris Lott [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I already use and am happy with a variety of text editors (vim, emacs,
 ultraedit, jedit, Homesite) depending on my needs, but I would like
 recommendations for a PHP specific IDE that will run on Windows XP.

 Specifically I am looking for something that can help with debugging,
 provides efficient code browsing (functions, objects, etc) across multiple
 files in a project, easy browsing through proper mappings to a development
 server/local server, and hooks to PHP reference/help/website.

 Needless to say, standard features like syntax highlighting, block
 formatting, etc. are a requirement.

 I've been looking at Zend Studio and Nusphere PHPEd as primary candidates.
 However, I have a short window to buy something (fiscal year issues) so
any
 comments on these two editors (separately or in comparison to one another)
 or other tools I should be looking at would be greatly appreciated!

 c
 --
 Chris Lott chris.lott[AT]gmail.com

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



[PHP] Re: Active PHP Sessions

2004-05-07 Thread Torsten Roehr
Paul Higgins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 I'm on a shared server, and I do not believe that I have access to the
/tmp
 directory where the session files are stored (I believe that is how it
works
 :).  I want to keep track of which sessions are active.  Basically, I just
 want a list of the active sessions for my site.

 How can I do this?

If you use a database as container for your session data you could easily do
a SELECT COUNT(*) FROM sessions to get the number of the sessions. Using a
DB as session container is also more secure on a shared server (at least
that's what I often read about session security).

Regards, Torsten


 Thanks!

 _
 Watch LIVE baseball games on your computer with MLB.TV, included with MSN
 Premium!

http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/dire
ct/01/

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



Re: [PHP] auto saving data in forms

2004-05-07 Thread Travis Low
To do this reliably, you'll need something like a Java applet.  In your shoes, 
I'd ask the customer how important this requirement REALLY is.  It will cost 
more to develop, and will increase the load on the database a LOT.

cheers,

Travis

[EMAIL PROTECTED] wrote:
i'm currently designing a website in which i have some forms with data saved in
database.
My customer wants that when he add or modify some datas in these forms, changes
will be made immediately in database. I really don't know how to do it and don't
know if it is possible. 

Is there anyone who have fijnd a solution to solve that problem and who can help
me. I accept solutions in other langages than PHP like JAVA + XML.
thanks,

Marc

--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 7 May 2004 13:30:10 -0000 Issue 2749

2004-05-07 Thread php-general-digest-help

php-general Digest 7 May 2004 13:30:10 - Issue 2749

Topics (messages 185579 through 185614):

Returning an object
185579 by: Aidan Lister
185581 by: Petr U.
185583 by: Curt Zirzow
185585 by: John W. Holmes
185603 by: Jay Blanchard

Re: strip comments from HTML?
185580 by: Justin French
185582 by: John W. Holmes
185586 by: Paul Chvostek

Re: Looking for Advanced PHP Developers
185584 by: Curt Zirzow

[Newbie Guide] For the benefit of new members
185587 by: Ma Siva Kumar

Socket
185588 by: Juan Pablo Herrera
185590 by: Petr U.

PHP Research
185589 by: Trevor Nesbit

setting php_admin_value 2
185591 by: Tim Traver

Best way to get mysql table metadata
185592 by: daniel.electroteque.org

Recommend an IDE for Windows
185593 by: Chris Lott
185595 by: Richard Davey
185612 by: Seth Bembeneck

HTML vs. Plain Text Input
185594 by: Matt Palermo
185596 by: Richard Davey

A work around my HTTP_REFERER Prob...
185597 by: Tristan.Pretty.risk.sungard.com
185601 by: Richard Harb
185606 by: Tristan.Pretty.risk.sungard.com
185608 by: Jason Wong

auto saving data in forms
185598 by: mserra.gdwd.com
185604 by: Jay Blanchard
185614 by: Travis Low

Showing only part of string
185599 by: Dave Carrera
185600 by: Richard Harb
185602 by: John W. Holmes
185605 by: Dave Carrera

Active PHP Sessions
185607 by: Paul Higgins
185609 by: Brent Clark
185610 by: Jason Wong
185611 by: John W. Holmes
185613 by: Torsten Roehr

Administrivia:

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

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

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


--
---BeginMessage---
How _should_ this be done? In terms of best practice.

?php
function foobar ()
{
return new SomeObject;
}
?

Or:

?php
function barfoo ()
{
$tempvar = new SomeObject;
return $tempvar
}
?

Please don't reply if you really, really don't know what you are talking
about.
---End Message---
---BeginMessage---
On Fri, 7 May 2004 11:35:24 +1000
Aidan Lister [EMAIL PROTECTED] wrote:

  How _should_ this be done? In terms of best practice.

I'd choose this way:

function foo()
{
return new Object;
}

-- 
Petr U.
---End Message---
---BeginMessage---
* Thus wrote Aidan Lister ([EMAIL PROTECTED]):
 How _should_ this be done? In terms of best practice.
 
 ?php
 function foobar ()
 {
 return new SomeObject;
 }
 ?
 
 Or:
 
 ?php
 function barfoo ()
 {
 $tempvar = new SomeObject;
 return $tempvar
 }
 ?

I'm not exactly sure what your looking for, this is like asking
what is better:

  $a = 'foo';
  echo $a;

  or 
  echo 'foo';

if tou want my opinion it should be written like this:
?php

/*
 * Create an instance of SomeObject
 */
function foobar() {
  return new SomeObject;
}


 
 Please don't reply if you really, really don't know what you are talking
 about.

What kind of requirement is this? Anyone can reply your email and
they will do so if they feel like it.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.
---End Message---
---BeginMessage---
Aidan Lister wrote:

Please don't reply if you really, really don't know what you are talking
about.
Okay, I won't reply.

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

php|architect: The Magazine for PHP Professionals  www.phparch.com
---End Message---
---BeginMessage---
[snip]
Please don't reply if you really, really don't know what you are talking
about.
[/snip]

Talk about alienating yourself right up front.
---End Message---
---BeginMessage---
Thanks to everyone who's replied... appears to be quite a tricky one!!

$text = preg_replace('/!--.*--/su','',$text);
Did not work (was too greedy, matched multiple comments)
$text = preg_replace('/!--.*?--/','',$text);
Did not work (needed multiple lines)
$text = preg_replace('/!--.*?--/su','',$text);
Does work so far, finger's crossed.
Thanks again to John, Paul, Rob, Tom, et al.

---
Justin French
http://indent.com.au
---End Message---
---BeginMessage---
Justin French wrote:

$text = preg_replace('/!--.*--/su','',$text);
Did not work (was too greedy, matched multiple comments)
Just for the record, it should be a capital 'U' for ungreedy. Lowercase 
'u' is something else. :)

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

php|architect: The Magazine for PHP Professionals  www.phparch.com
---End Message---
---BeginMessage---
On Thu, May 06, 2004 at 07:11:55PM +, Curt Zirzow wrote:
  
   $text=one !--bleh\nblarg - two\n;
   print ereg_replace(!--([^-][^-]?[^]?)*--, ,$text);
 
 Because your missing a -
 $text=one !--bleh\nblarg 

RE: [PHP] Header() and POST data

2004-05-07 Thread Lizet Peña de Sola

Hi, I had the same problem, had to send parameters through POST to a
second page I redirected to, I ended up using the curl library but I'm
still facing a few troubles with it, it redirects the page, the
parameters are sent through POST but the relative urls on the second
page are taking the first page's domain as its base path etc.
Any ideas?

Lizet

___

Caribbean Property Corporation Ltd.

Miramar Trade Center 

Edif Barcelona Ofic. 401

Miramar. Havana

www.caribbeanpropertycorp.com

Tel: 53-7-2047934

Fax: 53-7-2047934

_

Note: This communication is strictly confidential and is intended solely
for the person to whom it is addressed. If you are not the intended
recipient of this message, please be advised that any reproduction,
distribution or communication of this message is strictly prohibited. If
you have received this message in error, please notify us immediately
and destroy the original.



-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 06, 2004 4:51 PM
To: [EMAIL PROTECTED]
Cc: Gus Scherer
Subject: [PHP] Header() and POST data


I need to go to another page and I use the

header(location:  . $the_url_to_the_page);

Is it possible to use this method with POST so that the info does not 
show in the URL?

Todd

-- 
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] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Travis Low
How about something like this:

Write a script on server 1 to accept username and password parameters.  If 
successful, it echoes 1, if not, it echoes 0.

On server 2, you do something like this:

$s = file(http://server1?login.php?username=$usernamepassword=$password;);
if ($s[0])
{
# User is logged in.
}
You can also write the script on server1 so that it only returns 1 if the 
request came from server2.

Disclaimer: I know this scheme isn't airtight, but it beats relying on the referer.

cheers,

Travis

[EMAIL PROTECTED] wrote:
To recap...
We have two servers:
1. USA - holds most of our databases, and E-mail. but specifically, the 
usernames and passwords, or all our users (Lotus Domino Server)
2. UK - Runs our website. (Unix Server)

We wanted to be able to allow people to login on on server 1, and getr 
authenticated etc, and then get redirected to server 2.
Using http_referer we would confirm that they came from server 1

However, as I discovered, that is not possible.
So what we did was this:
On the login form on server 1, the referering URL to server 2, contains a 
varibale called 'secure'
we asign that variable that value of '4654376534' and divide it by the day 
(eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide by 
7)
I know that this is crackable, but it's just a stop gap measure...

My problem today is this:
It's not confirming the values?
See my code below

session_start();
$today_day = date(d);
$code1 = ($today_day+1) * $secure;
$code2 = $today_day * $secure;
$code3 = ($today_day-1) * $secure;
$master_code = 4654376534;
if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 == 
$master_code)) {
$_SESSION[logged] = 'true';
$login_info = You are now bLogged in/b;
} else if ($_SESSION[logged] == 'true') {
$login_info = You are still bLogged in/b;
}
=

I start by getting the date $today_day
As we're in two time zones, I don't wanna get caught out by the time 
difference, so I've created a +/- 1 each side ($code1-3)
and fianlly, asigned the master input variable (the decoder)

Now it all works great..! (all variables echo what they should) however, 
I'm not getting logged in?
I'm really stumped...
any ideas?

Tris...

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Active PHP Sessions

2004-05-07 Thread Paul Higgins
I've read stuff like that also.  However, if I choose to do this, I must 
write all the session handling myself, correct?  Are there any scripts 
already out there that do this?

Thanks


From: Torsten Roehr [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Active PHP Sessions
Date: Fri, 7 May 2004 15:30:29 +0200
Paul Higgins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 I'm on a shared server, and I do not believe that I have access to the
/tmp
 directory where the session files are stored (I believe that is how it
works
 :).  I want to keep track of which sessions are active.  Basically, I 
just
 want a list of the active sessions for my site.

 How can I do this?

If you use a database as container for your session data you could easily 
do
a SELECT COUNT(*) FROM sessions to get the number of the sessions. Using a
DB as session container is also more secure on a shared server (at least
that's what I often read about session security).

Regards, Torsten


 Thanks!

 _
 Watch LIVE baseball games on your computer with MLB.TV, included with 
MSN
 Premium!

http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/dire
ct/01/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

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


Re: [PHP] Active PHP Sessions

2004-05-07 Thread Paul Higgins
An active session would be one that has not expired.  Not necessarily that 
the user is not using the website.  If the user leaves the site, the PHP 
session does not necessarily expire at that time.  I want a list of PHP 
sessions that have not yet expired.

Thanks!

Paul


From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Active PHP Sessions
Date: Fri, 7 May 2004 20:50:18 +0800
On Friday 07 May 2004 20:32, Paul Higgins wrote:

 I'm on a shared server, and I do not believe that I have access to the 
/tmp
 directory where the session files are stored (I believe that is how it
 works

 :).

Of course you have access to it. The webserver needs to be able to READ the
session files that it writes and hence you're also able to access those 
files
with PHP.

 I want to keep track of which sessions are active.  Basically, I just

 want a list of the active sessions for my site.
You would have to define what /you/ mean by an active session.

 How can I do this?

i) There is no way to determine which session files are for your site 
without
actually examining their contents.

ii) PHP does not store any site identification info in the session files.

iii) Hence you need to store a (hopefully) unique string in all your 
sessions
then search for this string in the session files.

--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Phasers locked on target, Captain.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

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


Re: [PHP] Re: Active PHP Sessions

2004-05-07 Thread Torsten Roehr
Paul Higgins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I've read stuff like that also.  However, if I choose to do this, I must
 write all the session handling myself, correct?  Are there any scripts
 already out there that do this?

I'm using PEAR's HTTP_Session in combination with PEAR::DB:
http://pear.php.net/package/HTTP_Session
http://pear.php.net/package/DB

Although HTTP_Session is still in beta state I haven't experienced any
problems yet. Unfortunately there is no documention yet but if you have any
questions to get started just post on the PEAR mailing list. The session
table has a timestamp column named expiry which will make it easy to count
the active sessions. By the way, doing the DB session count should also be
faster than counting the files in your /tmp dir ;)

Regards, Torsten


 Thanks


 From: Torsten Roehr [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Active PHP Sessions
 Date: Fri, 7 May 2004 15:30:29 +0200
 
 Paul Higgins [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   Hi all,
  
   I'm on a shared server, and I do not believe that I have access to the
 /tmp
   directory where the session files are stored (I believe that is how it
 works
   :).  I want to keep track of which sessions are active.  Basically, I
 just
   want a list of the active sessions for my site.
  
   How can I do this?
 
 If you use a database as container for your session data you could easily
 do
 a SELECT COUNT(*) FROM sessions to get the number of the sessions. Using
a
 DB as session container is also more secure on a shared server (at least
 that's what I often read about session security).
 
 Regards, Torsten
 
  
   Thanks!
  
   _
   Watch LIVE baseball games on your computer with MLB.TV, included with
 MSN
   Premium!
  

http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/dir
e
 ct/01/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

 _
 FREE pop-up blocking with the new MSN Toolbar – get it now!
 http://toolbar.msn.com/go/onm00200415ave/direct/01/

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



[PHP] #209;

2004-05-07 Thread Diana Castillo
we are recieving  Ñ as #209;
¿what type of code is that?
Is there a function in php to convert it?

--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
  http://www.destinia.com

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



Re: [PHP] Re: Active PHP Sessions

2004-05-07 Thread Richard Harb
Friday, May 7, 2004, 3:40:06 PM, thus was written:
 I've read stuff like that also.  However, if I choose to do this, I must
 write all the session handling myself, correct?

Well, yes and no:
You could still use the default session handler and just add a
function/whatever to the top of the page that updates the database,
reads the number of sessions and on occasion makes a garbage
collection:

You could for eaxmple use a simple table with two columns:
session_id, last_access

if ( there is a valid session )
   update last access of this session_id in the table
   // if mySQL you could use a REPLACE INTO
   count number of sessions
 WHERE last_access  timespan counting as active session
   // have some basic form of garbage collection
   if ( rand (1, n) == 1 ) delete from session
  WHERE last_access  session timeout

I think that might work... (at least it's an outline of how I did it.)

Two/three (depending on the database) DB queries and on occasion
three/four .. not too much overhead, considering you would have to
read the whole session directory if you chose to check the files...

my 2c
Richard



From: Torsten Roehr [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Active PHP Sessions
Date: Fri, 7 May 2004 15:30:29 +0200

Paul Higgins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  Hi all,
 
  I'm on a shared server, and I do not believe that I have access to the
/tmp
  directory where the session files are stored (I believe that is how it
works
  :).  I want to keep track of which sessions are active.  Basically, I
just
  want a list of the active sessions for my site.
 
  How can I do this?

If you use a database as container for your session data you could easily
do
a SELECT COUNT(*) FROM sessions to get the number of the sessions. Using a
DB as session container is also more secure on a shared server (at least
that's what I often read about session security).

Regards, Torsten

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



Re: [PHP] Re: strip comments from HTML?

2004-05-07 Thread Rob Ellis
On Thu, May 06, 2004 at 11:48:36PM -0400, Paul Chvostek wrote:
 On Thu, May 06, 2004 at 07:11:55PM +, Curt Zirzow wrote:
   
$text=one !--bleh\nblarg - two\n;
print ereg_replace(!--([^-][^-]?[^]?)*--, ,$text);
  
  Because your missing a -
  $text=one !--bleh\nblarg -- two\n;
 
 /me applies mallet to head
 
  % php -r '$text=one !--bleh\nblarg -- two\n; print 
 ereg_replace(!--([^-][^-]?[^]?)*--, ,$text);'
  one  two
 
 whee, it works!  :)
 

you're still missing things like ! START -...
don't know how you can get around that with ereg.

also preg_replace('/!--.*?--/s', ...) is much faster. :-)

- rob

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



[PHP] Installing GD library

2004-05-07 Thread Phpu
Hi,
I've downloaded the GD library. Can someone tell me how do i install it on a windows 
system?
I found in internet a few articles but  i don't quite understand.
Thanks 


[PHP] LAMP

2004-05-07 Thread Brent Clark
Hi

Anyone know what LAMP stand for

Kind Regards
Brent Clark

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



RE: [PHP] LAMP

2004-05-07 Thread Jay Blanchard
[snip]
Anyone know what LAMP stand for
[/snip]


All of us but you.

Linux Apache MySQL PHP

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



Re: [PHP] LAMP

2004-05-07 Thread Clifford W. Hansen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday 07 May 2004 16:59, Brent Clark wrote:
 Anyone know what LAMP stand for
Linux
Apache
MySQL
PHP
- -- 
Thank You,

Clifford W. Hansen
Operations Support Developer
Aspivia (Pty) Ltd.

+27 (0) 11 259-1150 (Switchboard)
+27 (0) 11 259-1019 (Fax)
+27 (0) 83 761-0240 (Mobile)
[EMAIL PROTECTED] (EMail)
http://chansen.aspivia.com (Web)

We have seen strange things today! Luke 5:26

This message contains information intended for the perusal, and/or use (if so 
stated), of the stated addressee(s) only. The information is confidential and 
privileged. If you are not an intended recipient, do not peruse, use, 
disseminate, distribute, copy or in any manner rely upon the information 
contained in this message (directly or indirectly). The sender and/or the 
entity represented by the sender shall not be held accountable in the event 
that this prohibition is disregarded.

If you receive this message in error, notify the sender immediately by e-mail, 
fax or telephone and return and/or destroy the original message.

The views or representations contained in this message, whether express or 
implied, are those of the sender only, unless that sender expressly states 
them to be the views or representations of an entity or person, who shall be 
named by the sender and who the sender shall state to represent. No liability 
shall otherwise attach to any other entity or person.

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

iQCVAwUBQJuk090vijRqUwkiAQLs6QP+NBh3Cb8+MQV9Wh1uOJcxkt3S2tLb8DFh
1GZ04x8q9VrMrnxiUENulDSA/Dgkpp53+PtdBcmGqaS+9adb6VSA5mxvQFUc9LB4
xc32XPSuMjY6kZMhzCGNBooeMOC4CsI0oLiwbdzBaQAkek8lmvhYfzi63mVG20Oq
sZK3xSrpsIo=
=nvS0
-END PGP SIGNATURE-

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



RE: [PHP] LAMP

2004-05-07 Thread Adam Voigt
I've also heard the Perl Zealots claim the P could or does stand for
Perl, but ignore there Jedi mind tricks.


On Fri, 2004-05-07 at 11:00, Jay Blanchard wrote:
 [snip]
 Anyone know what LAMP stand for
 [/snip]
 
 
 All of us but you.
 
 Linux Apache MySQL PHP
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP] frameworks

2004-05-07 Thread Edward Peloke
Ok...I don't want to start a flame war but I have a project coming up with a
very short code cycle...2-3 weeks.  I am a procedural guy but want to do
more OOP in this project...what are the votes for a good overall framework
to use?  I need good seperation of code and presentation (smarty) but also
want to simply stuff like forms, db, etc.

Thanks,
Eddie

 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

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



[PHP] LAMP - Thanks

2004-05-07 Thread Brent Clark
Hi

Thank you
And yes, I feel like a dork, for not knowing this.
LOL

Enjoy the weekend, where ever you may be.

Brent

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



Re: [PHP] A work around my HTTP_REFERER Prob...

2004-05-07 Thread Tristan . Pretty
Cheers for all ideas/suggetions so far..
I've made a little progres...
Visit this URL:
http://www.risk.sungard.com/secure.php?secure=126807.714285714

and here's the code..
?
$today_day = date(d);
$code1 = ($today_day+1) * $_GET[secure];
$code2 = $today_day * $_GET[secure];
$code3 = ($today_day-1) * $_GET[secure];
$master_code = 887654;

if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 == 
$master_code)) {
$woopee = h2DONE IT!!!/h2;
}

?
html
head
titleSecure Test/title
/head
body
?=$woopee ?
bDebug:/b
br /Secure: ?=$_GET[secure] ?
br /Day: ?=$today_day ?
br /Master: ?=$master_code ? 
br /Code 1: ?=$code1 ?
br /Code 2: ?=$code2 ?
br /Code 3: ?=$code3 ?
/body
/html

If I change the GET requests to simple variables, and assign a new 
variable called $secure, and asign it the value: 126807.714285714
The page works!
Makes me think there's a GET error?

Can anyone spot my potentially obvious error?

Tris...






Jason Wong [EMAIL PROTECTED] 
07/05/2004 13:37

To
[EMAIL PROTECTED]
cc

Subject
Re: [PHP] A work around my HTTP_REFERER Prob...






On Friday 07 May 2004 20:05, [EMAIL PROTECTED] wrote:

  varibale called 'secure'
  we asign that variable that value of '4654376534' and divide it by the

 day

  (eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide

 by

  7)

That would result in a floating point number ...

  if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 ==
  $master_code)) {

... which does not lend easily to such comparisons.

If you're still intent on using this *ahem* 'security' scheme then I 
suggest 
you use multiplication instead (just make sure that the largest number 
you're 
processing is less than 2147483648 - or use the BCMath functions).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
After all, it is only the mediocre who are always at their best.
 -- Jean Giraudoux
*/

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





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



Re: [PHP] frameworks

2004-05-07 Thread Robert Cummings
On Fri, 2004-05-07 at 11:14, Edward Peloke wrote:
 Ok...I don't want to start a flame war but I have a project coming up with a
 very short code cycle...2-3 weeks.  I am a procedural guy but want to do
 more OOP in this project...what are the votes for a good overall framework
 to use?  I need good seperation of code and presentation (smarty) but also
 want to simply stuff like forms, db, etc.

InterJinn :)

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

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



Re: [PHP] LAMP

2004-05-07 Thread John Nichel
Adam Voigt wrote:
I've also heard the Perl Zealots claim the P could or does stand for
Perl, but ignore there Jedi mind tricks.
What what what could you be talking about?

*quickly hides Camel book*

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] frameworks

2004-05-07 Thread Jay Blanchard
[snip]
Ok...I don't want to start a flame war but I have a project coming up
with a
very short code cycle...2-3 weeks.  I am a procedural guy but want to do
more OOP in this project...what are the votes for a good overall
framework
to use?  I need good seperation of code and presentation (smarty) but
also
want to simply stuff like forms, db, etc.
[/snip]

I think Robert Cummings will probably say InterJinn :)

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



[PHP] PHP Website Architecture

2004-05-07 Thread Paul Higgins
Hi all,

I have a question regarding website design with PHP.  Is it better to have a 
single PHP script produce different content or have a separate PHP script 
for every action.

For example, if an error occurs, should I have the same PHP script produce 
an error page or have a separate PHP script produce the error page.

I'm asking in reference to performance.

Thanks!

_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


RE: [PHP] PHP Website Architecture

2004-05-07 Thread Jay Blanchard
[snip]
I have a question regarding website design with PHP.  Is it better to
have a 
single PHP script produce different content or have a separate PHP
script 
for every action.

For example, if an error occurs, should I have the same PHP script
produce 
an error page or have a separate PHP script produce the error page.

I'm asking in reference to performance.
[/snip]

In reference to performance this shouldn't matter.

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



RE: [PHP] PHP Website Architecture

2004-05-07 Thread Ryan A

On 5/7/2004 5:47:47 PM, Jay Blanchard ([EMAIL PROTECTED])
wrote:
 [snip]
 I have a question regarding website design with PHP.  Is it better to
 have a
 single PHP script produce different content or have a separate PHP
 script
 for every action.

 For example, if an error occurs, should I have the same PHP script
 produce
 an error page or have a separate PHP script produce the error page.

 I'm asking in reference to performance.
 [/snip]

If you are thinking only of performance this wont matter at all, but
sometimes for the sake of simplicity and easier management of code it is
good to split files for different tasks.
Nearly all programs can be written in *one* very large .php file but just
thinking of going back in to make changes 3 months down the road would be a
nightmare.

HTH.

Cheers,
-Ryan

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



RE: [PHP] PHP Website Architecture

2004-05-07 Thread Paul Higgins
Ok, thanks.  I didn't think it would make a difference.  And I agree, 
splitting things up makes things a lot easier.

Thanks!


From: Ryan A [EMAIL PROTECTED]
Reply-To: Ryan A [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP Website Architecture
Date: Fri, 7 May 2004 17:51:45 +0200
On 5/7/2004 5:47:47 PM, Jay Blanchard ([EMAIL PROTECTED])
wrote:
 [snip]
 I have a question regarding website design with PHP.  Is it better to
 have a
 single PHP script produce different content or have a separate PHP
 script
 for every action.

 For example, if an error occurs, should I have the same PHP script
 produce
 an error page or have a separate PHP script produce the error page.

 I'm asking in reference to performance.
 [/snip]

If you are thinking only of performance this wont matter at all, but
sometimes for the sake of simplicity and easier management of code it is
good to split files for different tasks.
Nearly all programs can be written in *one* very large .php file but just
thinking of going back in to make changes 3 months down the road would be a
nightmare.
HTH.

Cheers,
-Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

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


Re[2]: [PHP] PHP Website Architecture

2004-05-07 Thread Richard Davey
Hello Ryan,

Friday, May 7, 2004, 4:51:45 PM, you wrote:

RA Nearly all programs can be written in *one* very large .php file but just
RA thinking of going back in to make changes 3 months down the road would be a
RA nightmare.

I was just looking at this the other day - I had a local site running
here and profiling the index page took around 800ms with 30 include
files. Out of interest I dumped a load of those files into one and
re-profiled it (11 includes rather than 300) and the load time dropped
dramatically (300ms). I know there are other factors at play here
(Windows vs. Unix, cached vs. needing to seek across the hard drive
every time), but the difference still surprised me. Of course I could
never cope with all of those files as one, but I will definitely
keep them split up locally and combine into one when published live.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] PHP Website Architecture

2004-05-07 Thread David T-G
Ryan, et al --

...and then Ryan A said...
% 
% 
% On 5/7/2004 5:47:47 PM, Jay Blanchard ([EMAIL PROTECTED])
% wrote:
[snip]

Did you realize that you quoted Jay's quote of Paul's original note but
then snipped off Jay's comment? :-)


...
% If you are thinking only of performance this wont matter at all, but
% sometimes for the sake of simplicity and easier management of code it is
% good to split files for different tasks.

Agreed.


% Nearly all programs can be written in *one* very large .php file but just
% thinking of going back in to make changes 3 months down the road would be a
% nightmare.

Now, now...  If you structure your code effectively it's no harder to
edit one large file than it is to edit a bunch of smaller files.  I agree
that sometimes breaking up is a good thing, but I haven't the slightest
problem working in the single main (and large) script for our gallery
engine, amongst other projects, and as an added bonus I don't have to
remember in which file to search, months later, when I'm tracking a bug
(er, reconsidered feature, since there are no bugs in my code! ;-)


% 
% HTH.
% 
% Cheers,
% -Ryan


HTH  HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Re: Active PHP Sessions

2004-05-07 Thread zooming
adodb also handles sessions in a database
http://phplens.com/lens/adodb/docs-session.htm


- Original Message - 
From: Paul Higgins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, May 07, 2004 9:40 AM
Subject: RE: [PHP] Re: Active PHP Sessions


 I've read stuff like that also.  However, if I choose to do this, I must
 write all the session handling myself, correct?  Are there any scripts
 already out there that do this?

 Thanks


 From: Torsten Roehr [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Active PHP Sessions
 Date: Fri, 7 May 2004 15:30:29 +0200
 
 Paul Higgins [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   Hi all,
  
   I'm on a shared server, and I do not believe that I have access to the
 /tmp
   directory where the session files are stored (I believe that is how it
 works
   :).  I want to keep track of which sessions are active.  Basically, I
 just
   want a list of the active sessions for my site.
  
   How can I do this?
 
 If you use a database as container for your session data you could easily
 do
 a SELECT COUNT(*) FROM sessions to get the number of the sessions. Using
a
 DB as session container is also more secure on a shared server (at least
 that's what I often read about session security).
 
 Regards, Torsten
 
  
   Thanks!
  
   _
   Watch LIVE baseball games on your computer with MLB.TV, included with
 MSN
   Premium!
  

http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/dir
e
 ct/01/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

 _
 FREE pop-up blocking with the new MSN Toolbar - get it now!
 http://toolbar.msn.com/go/onm00200415ave/direct/01/

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

2004-05-07 Thread Robert Cummings
On Fri, 2004-05-07 at 11:24, Jay Blanchard wrote:
 [snip]
 Ok...I don't want to start a flame war but I have a project coming up
 with a
 very short code cycle...2-3 weeks.  I am a procedural guy but want to do
 more OOP in this project...what are the votes for a good overall
 framework
 to use?  I need good seperation of code and presentation (smarty) but
 also
 want to simply stuff like forms, db, etc.
 [/snip]
 
 I think Robert Cummings will probably say InterJinn :)

It's a miracle!!! Are you related to Nostradamus? :)

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

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



Re: Re[2]: [PHP] PHP Website Architecture

2004-05-07 Thread Robert Cummings
On Fri, 2004-05-07 at 12:00, Richard Davey wrote:
 Hello Ryan,
 
 Friday, May 7, 2004, 4:51:45 PM, you wrote:
 
 RA Nearly all programs can be written in *one* very large .php file but just
 RA thinking of going back in to make changes 3 months down the road would be a
 RA nightmare.
 
 I was just looking at this the other day - I had a local site running
 here and profiling the index page took around 800ms with 30 include
 files. Out of interest I dumped a load of those files into one and
 re-profiled it (11 includes rather than 300) and the load time dropped
 dramatically (300ms). I know there are other factors at play here
 (Windows vs. Unix, cached vs. needing to seek across the hard drive
 every time), but the difference still surprised me. Of course I could
 never cope with all of those files as one, but I will definitely
 keep them split up locally and combine into one when published live.

I think there was a recent discussion on the internals list that
mentioned how the realpath lookup for files is fairly slow and that it
can have an impact :/

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

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



Re: [PHP] #209;

2004-05-07 Thread Curt Zirzow
* Thus wrote Diana Castillo ([EMAIL PROTECTED]):
 we are recieving  Ñ as #209;
 ¿what type of code is that?

Thats an html entity code.

 Is there a function in php to convert it?

echo chr(substr('#209;', 2, 3));


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] html form elements as php arrays

2004-05-07 Thread John Nichel
Matthew Oatham wrote:

Hi,

I am retrieving data from a database and displaying results on a html so
the user can edit them, I am sending the html form back to the server as an
array, i.e on my html for I might have 10 name fields so in the html code
all name fields are named name[] then I can iterate through the array on the
server. My problem isn't strictly php but more html / javascript. if I have
a load of form field elements all named name[] how do I access them to do
javascript validation? i.e document.form.name[].value doesn't work!
Cheers

Matt
Please wrap your lines.

document.form.elements['name[]'].value

Matthew Oatham wrote:
 Mmmm that didn't work either!

 Thanks anyway

 Matt
Please reply to the list, and not just an individual person.

Anywho, if you want to address an element whose name contains special 
characters, the above way does work.

If these are check boxes, you have to loop thru them.  If these are 
text, you will have to loop thru all the elements on the page, and 
'look' for them. etc.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Returning an object

2004-05-07 Thread Justin Patrin
Aidan Lister wrote:

How _should_ this be done? In terms of best practice.

?php
function foobar ()
{
return new SomeObject;
}
?
Or:

?php
function barfoo ()
{
$tempvar = new SomeObject;
return $tempvar
}
?
Please don't reply if you really, really don't know what you are talking
about.
Some earlier versions of PHP5 would not allow returning by reference of 
a function call or a new call. It was very recently added, but may not 
be in RC2 (not sure). You had to assign to a variable before you returned.

Here's my 2c:

function foobar() {
  return new SomeObject;
}
--
paperCrane Justin Patrin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Resequencing logic

2004-05-07 Thread Matt Grimm
I apologize if this message is a repeat; I've had trouble posting with 
Thunderbird.

I'm interested in how you folks would approach the following issue:

You have a list of data, in a user-defined sequence.  For instance, a list 
of song titles that can be rearranged on a web page in any order. I don't 
think I have the best grasp of the logic involved, and as such, the problem 
is a real pain for me.  I use this approach:

-If adding, records after or equal to the new (requested) spot are 
incremented
-If moving up, records before the current spot and after or equal to the 
new spot are incremented
-If moving down, records after the current spot and before or equal to the 
new spot are decremented
-If deleting, records after or equal to the current spot are decremented

Is there some MySQL or PHP function that will handle this sort of 
reordering business, or is there possibly a simpler logic I could use?

Thanks,
Matt
[EMAIL PROTECTED]

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



[PHP] Re: Best way to get mysql table metadata

2004-05-07 Thread Justin Patrin
[EMAIL PROTECTED] wrote:

Hi there, I am trying to upgrade my db class, so I can tell if what table
type of the table being queried is. More specifically i need to work out if
the table is an innodb transaction table, if so I would like to start the
transaction and commit and rollback when needed.
Let me know.
Hmmmis this a general DB abstraction class or one you personally 
use? You may want to look into using PEAR's DB or MDB, or perhaps one of 
the others (Metabase, ADOdb, etc.).

If you still want to use your own, I would suggest looking at the 
DESCRIBE sql command for column specs and, at least in mysql, you can 
use: show create table tableName; to get a table's create statement (and 
type).

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


Re: [PHP] #209;

2004-05-07 Thread John W. Holmes
From: Curt Zirzow [EMAIL PROTECTED]
 * Thus wrote Diana Castillo ([EMAIL PROTECTED]):
  we are recieving  Ñ as #209;
  ¿what type of code is that?

 Thats an html entity code.

  Is there a function in php to convert it?

 echo chr(substr('#209;', 2, 3));

also,

http://us2.php.net/manual/en/function.html-entity-decode.php

---John Holmes...

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



[PHP] newbies was:Re: [PHP] Socket

2004-05-07 Thread raditha dissanayake
Juan Pablo Herrera wrote:

Hi!
Please, i need a tutorial about socket. I read php.net but the examples is
lost.
Regards,
Juan Pablo
 



A classic example of not bothering to follow list guide lines. This 
original message is hijacking the newbie guide thread.

--
Raditha Dissanayake.
-
http://www.radinks.com/print/upload.php
SFTP, FTP and HTTP File Upload solutions 

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


[PHP] form submission logic

2004-05-07 Thread Aaron Wolski
Hi all,
 
Was wondering if someone had any idea's on this logic and if it'd work,
before I tried to implement it:
 
Within the form/form tags I have my buttons - Publish, Unpublish,
New, Edit and Delete.
 
Next I have a table of that displays a list of records from a database
with a checkbox to select a particular record.
 
Once a record has been selected they click one of the top buttons to
perform their desired action.
 
WILL this work OR do the buttons HAVE to go at the bottom?
 
Thanks! Any help is appreciated.
 
Regards,
 
Aaron
 


[PHP] Re: form submission logic

2004-05-07 Thread Torsten Roehr
Aaron Wolski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 Was wondering if someone had any idea's on this logic and if it'd work,
 before I tried to implement it:

 Within the form/form tags I have my buttons - Publish, Unpublish,
 New, Edit and Delete.

 Next I have a table of that displays a list of records from a database
 with a checkbox to select a particular record.

 Once a record has been selected they click one of the top buttons to
 perform their desired action.

 WILL this work OR do the buttons HAVE to go at the bottom?

This is more of a HTML than a PHP question, but anyway:
It doesn't matter where you put the buttons as long as they are INSIDE the
form-tag and have different names.

Regards, Torsten


 Thanks! Any help is appreciated.

 Regards,

 Aaron



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



[PHP] Having a problem with RCPT TO and email

2004-05-07 Thread Todd Cary
I am sending the following:

  fputs($smtp, RCPT TO: [EMAIL PROTECTED]\r\n);

and when I receive the email, it has a Bcc: rather than a To:.  Am I 
overlooking something here?

Todd

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


Re: [PHP] Re: form submission logic

2004-05-07 Thread Adam Voigt
On Fri, 2004-05-07 at 13:47, Torsten Roehr wrote:
 
 This is more of a HTML than a PHP question, but anyway:
 It doesn't matter where you put the buttons as long as they are INSIDE the
 form-tag and have different names.
 

Actually you don't even have to have names for the buttons, for example:

input type=button value=Whatever onclick=javascript:doit();

input type=button value=Whatever onclick=javascript:doit2();


-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Re: form submission logic

2004-05-07 Thread Torsten Roehr
Adam Voigt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Fri, 2004-05-07 at 13:47, Torsten Roehr wrote:
 
  This is more of a HTML than a PHP question, but anyway:
  It doesn't matter where you put the buttons as long as they are INSIDE
the
  form-tag and have different names.
 

 Actually you don't even have to have names for the buttons, for example:

 input type=button value=Whatever onclick=javascript:doit();

 input type=button value=Whatever onclick=javascript:doit2();

I see your point but why using Javascript where it's not required?

Regards, Torsten



 --

 Adam Voigt
 [EMAIL PROTECTED]

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



Re: [PHP] Having a problem with RCPT TO and email

2004-05-07 Thread Petr U.
On Fri, 07 May 2004 10:49:08 -0700
Todd Cary [EMAIL PROTECTED] wrote:

 fputs($smtp, RCPT TO: [EMAIL PROTECTED]\r\n);

You should (are you doing?) something like this:

-- cut --
HELO blah
MAIL FROM: [EMAIL PROTECTED]
RCPT TO: [EMAIL PROTECTED]
DATA
From: My real name [EMAIL PROTECTED]
To: Your real name [EMAIL PROTECTED]
Subject: Something to test
..blank line..
Hello,

blah blah

--
Bye
.
-- cut --

-- 
Petr U.

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



Re: [PHP] form submission logic

2004-05-07 Thread John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED]

 Within the form/form tags I have my buttons - Publish, Unpublish,
 New, Edit and Delete.

 Next I have a table of that displays a list of records from a database
 with a checkbox to select a particular record.

 Once a record has been selected they click one of the top buttons to
 perform their desired action.

 WILL this work OR do the buttons HAVE to go at the bottom?

The buttons can go anywhere inside the form tags. Since this is a PHP
list, though, you should really be asking is how would this form best work
with PHP to perform each desired action?

---John Holmes...

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



[PHP] Re: Resequencing logic

2004-05-07 Thread Kim Steinhaug
Well, this is much the same as any CMS system where you are able to
sort the contents by your own, in your case song titles.

One way to solve this is by using form fields together with your listings
so that you have some sort of link to the posts in your database. You
also need a field in the database that keeps track of the sort. You also
need abit of javascript.

EG.

ID, SONG TITLE, SORTER

Lets have some data,
1, Limbo, 5
2, Bimbo, 6
3, Cimba, 1

This will be presented :
Cimba (1)
Limbo (5)
Bimbo (6)

When you print out the HTML I would include some hidden form
fields for each item so that I know what to sort / move up / down.

Eg.
hidden name=data[item][$i] value=ID/ Cimba (hidden ID=3)
hidden name=data[item][$i] value=ID/ Limbo (hidden ID=1)
hidden name=data[item][$i] value=ID/ Bimbo (hidden ID=2)

Each line would need some sort of javascript command, like
javascript=moveup($i)

Assign this moveup() variable to anything, eg. hidden name=check value=**
so we
can access it from PHP.

Your javascript will then submit the form with ALL variables mentioned
above.

So do we now know?

1. We have a complete array of all the records from the HTML page in
$_POST[data][item]
2. We also know what database ID each item has with the twin array
$_POST[data][id]

If we were to move something up, now we have a way of doing so, since :
Say you entered moveup(2), which the javascript assigned the 2 to a
variable check which we
now know as $_POST[check]. Moving 2 (Which is 3 since we start counting
from 0) we know
that 2 is supposed to switch places with 1, meaning the SORTER will be
switched.

so we know the following :

$data = $_POST[item];
$sourceID  = $data[item][$_POST[check]];
$destinationID = $data[item][$_POST[check]-1];

The rest would be to do the SQL queries for the SORTER field,
A=C,
B=A,
C=B

meaning :
tempA = select sorter from blabla wher id = source
tempB = select sorter from blabla wher id = destination
update blabla set sorter=destination where id = source
update blabla set sorter=source where id = destination

This was all abit quick'n'dirty as I call it, but I hope you got the general
idea on how to do it. You need ofcourse alot more debugging and such
for the final code (Like you cand moveUP the first row, since that would
make the array go from 0 to -1 which doesnt make sence).

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

Matt Grimm [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I apologize if this message is a repeat; I've had trouble posting with
 Thunderbird.

 I'm interested in how you folks would approach the following issue:

 You have a list of data, in a user-defined sequence.  For instance, a list
 of song titles that can be rearranged on a web page in any order. I don't
 think I have the best grasp of the logic involved, and as such, the
problem
 is a real pain for me.  I use this approach:

 -If adding, records after or equal to the new (requested) spot are
 incremented
 -If moving up, records before the current spot and after or equal to the
 new spot are incremented
 -If moving down, records after the current spot and before or equal to the
 new spot are decremented
 -If deleting, records after or equal to the current spot are decremented

 Is there some MySQL or PHP function that will handle this sort of
 reordering business, or is there possibly a simpler logic I could use?

 Thanks,
 Matt
 [EMAIL PROTECTED]

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



RE: [PHP] form submission logic

2004-05-07 Thread Aaron Wolski
 The buttons can go anywhere inside the form tags. Since this is a
PHP
 list, though, you should really be asking is how would this form best
work
 with PHP to perform each desired action?
 
 ---John Holmes...

Yeah, John, you're right. I should have made it more PHP related.

Figured I could get away with it a slighty because PHP will be involved
in the back-end processing? :)

Thanks for the input everyone.

A

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



[PHP] Profiling (Was: Re: [PHP] PHP Website Architecture)

2004-05-07 Thread Travis Low
Hi Richard,

Just curious...how do you do your profiling?

cheers,

Travis

Richard Davey wrote:
Hello Ryan,

Friday, May 7, 2004, 4:51:45 PM, you wrote:

RA Nearly all programs can be written in *one* very large .php file but just
RA thinking of going back in to make changes 3 months down the road would be a
RA nightmare.
I was just looking at this the other day - I had a local site running
here and profiling the index page took around 800ms with 30 include
files. Out of interest I dumped a load of those files into one and
re-profiled it (11 includes rather than 300) and the load time dropped
dramatically (300ms). I know there are other factors at play here
(Windows vs. Unix, cached vs. needing to seek across the hard drive
every time), but the difference still surprised me. Of course I could
never cope with all of those files as one, but I will definitely
keep them split up locally and combine into one when published live.
--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php_admin values solution

2004-05-07 Thread Tim Traver
Just in case anyone wants to know the solution, I found one on the apache 
list...

Apparently, from within an apache module, one can use the function

zend_alter_ini_entry(open_basedir, 13, path, strlen(path), 4, 16);

This function is included in the zend base libraries, and will let you set 
the php admin variables on the fly...

Thanks,

Tim.

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


[PHP] please remove this user

2004-05-07 Thread Tim Traver
Can any admin remove this user from the list ?

Advance Credit Suisse Bank [EMAIL PROTECTED]

Every time I post, I get an autoresponse from that address...

Anyone else get that ?

Thanks,

Tim.

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


[PHP] Re: please remove this user

2004-05-07 Thread Torsten Roehr
Tim Traver [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Can any admin remove this user from the list ?

 Advance Credit Suisse Bank [EMAIL PROTECTED]

 Every time I post, I get an autoresponse from that address...

 Anyone else get that ?

Unfortunately, yes.

Torsten


 Thanks,

 Tim.

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



Re: [PHP] Profiling (Was: Re: [PHP] PHP Website Architecture)

2004-05-07 Thread Richard Davey
Hello Travis,

Friday, May 7, 2004, 7:06:03 PM, you wrote:

TL Hi Richard,
TL Just curious...how do you do your profiling?

Zend IDE.

View the page in IE, click the Profile button, analyse the pretty
pie-charts and graphs and stack trace until I see where the bottle
necks are :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] please remove this user

2004-05-07 Thread John Nichel
Tim Traver wrote:
Can any admin remove this user from the list ?

Advance Credit Suisse Bank [EMAIL PROTECTED]

Every time I post, I get an autoresponse from that address...

Anyone else get that ?

Thanks,

Tim.
Send it to /dev/null (or make a filter for it in your mail client).

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Having a problem with RCPT TO and email

2004-05-07 Thread Todd Cary
DATA
From: My real name [EMAIL PROTECTED]  
To: Your real name [EMAIL PROTECTED]  
Subject: Something to test
That's it!

Thanks!

Petr U. wrote:
On Fri, 07 May 2004 10:49:08 -0700
Todd Cary [EMAIL PROTECTED] wrote:
 fputs($smtp, RCPT TO: [EMAIL PROTECTED]\r\n);

You should (are you doing?) something like this:

-- cut --
HELO blah
MAIL FROM: [EMAIL PROTECTED]
RCPT TO: [EMAIL PROTECTED]
DATA
From: My real name [EMAIL PROTECTED]
To: Your real name [EMAIL PROTECTED]
Subject: Something to test
..blank line..
Hello,
blah blah

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


[PHP] Re: form submission logic

2004-05-07 Thread Kim Steinhaug
Well,

I would include another hidden field and name it something like ACTION.
I would also include a checkbox on every item you want to do something with
like this :

input type=checkbox name=item[] value=?=$databaseID?

Then use javascript on your actions to set the action to whatever mode you
need,
for example delete. On the PHP side you get a very nice workflow now, as
you
will recieve an array on all the items which are selected and you can
perform
multiple tasks at once. Example, publish n articles in one go, or delete all
at once.

Remember to valiudate the $_POST[item] as an array! Remember, all the
values
in this array will be the onces you should $_POST[action].

Have fun!

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

Aaron Wolski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 Was wondering if someone had any idea's on this logic and if it'd work,
 before I tried to implement it:

 Within the form/form tags I have my buttons - Publish, Unpublish,
 New, Edit and Delete.

 Next I have a table of that displays a list of records from a database
 with a checkbox to select a particular record.

 Once a record has been selected they click one of the top buttons to
 perform their desired action.

 WILL this work OR do the buttons HAVE to go at the bottom?

 Thanks! Any help is appreciated.

 Regards,

 Aaron



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



Re: [PHP] php_admin values solution

2004-05-07 Thread Curt Zirzow
* Thus wrote Tim Traver ([EMAIL PROTECTED]):
 Just in case anyone wants to know the solution, I found one on the apache 
 list...
 
 Apparently, from within an apache module, one can use the function
 
 zend_alter_ini_entry(open_basedir, 13, path, strlen(path), 4, 16);

I am curious as why you want to make a module to have it override
admin set settings in php userland.  There is a reason why admin
values are set.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: PHP Website Architecture

2004-05-07 Thread Kim Steinhaug
Well if you really want to do it the perfect way, I would recommend
using only one PHP file to generate the whole site. Or if you like, have
one file with all the functions.

You should also read into classess and create most of the functions
as classess.

To do the error handling there are many ways to go, but the best way
would be to use output buffering. If an error occurs you can store the
entire buffer if you like into a database and present an entire different
page to the user informing that samoething went wrong. The old alternative
is to present a 50/50 page with some error handling here and there.

Its really all up to you, there isnt a perfect way in doing this. But my
advice again, use classess (OOP) as its very reusable and look at
output buffering for total control.

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

Paul Higgins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 I have a question regarding website design with PHP.  Is it better to have
a
 single PHP script produce different content or have a separate PHP script
 for every action.

 For example, if an error occurs, should I have the same PHP script produce
 an error page or have a separate PHP script produce the error page.

 I'm asking in reference to performance.

 Thanks!

 _
 Is your PC infected? Get a FREE online computer virus scan from McAfee®
 Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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



Re: [PHP] Login page

2004-05-07 Thread Erik Gjertsen
Thanks it help
Erik Gjertsena
Petr U. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Thu, 6 May 2004 03:42:48 -0700
 Erik Gjertsen [EMAIL PROTECTED] wrote:

   I have made a login page but I got an error on line 1.

 Where did you defined $dbc? Nowhere.
 From mysql_select_db($database_innlogging, $innlogging); I guessing,
that
 you shuld use:

   global $innlogging;
   ...
   return mysql_real_escape_string($data, $innlogging);

 --
 Petr

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



[PHP] Re: Installing GD library

2004-05-07 Thread Kim Steinhaug
put the DLL file in your PHP DLL file directory,
uncomment the line in php.ini referring to it.

Restart apache if running, IIS doesnt need to be restarted.

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

Phpu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I've downloaded the GD library. Can someone tell me how do i install it on a
windows system?
I found in internet a few articles but  i don't quite understand.
Thanks

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



RE: [PHP] Re: Installing GD library

2004-05-07 Thread Aaron Wolski
Now... what about installing for Linux?

Any ideas? :)

Aaron

 -Original Message-
 From: Kim Steinhaug [mailto:[EMAIL PROTECTED]
 Sent: May 7, 2004 2:57 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Installing GD library
 
 put the DLL file in your PHP DLL file directory,
 uncomment the line in php.ini referring to it.
 
 Restart apache if running, IIS doesnt need to be restarted.
 
 --
 --
 Kim Steinhaug
 --
 There are 10 types of people when it comes to binary numbers:
 those who understand them, and those who don't.
 --
 www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
 --
 
 Phpu [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Hi,
 I've downloaded the GD library. Can someone tell me how do i install
it on
 a
 windows system?
 I found in internet a few articles but  i don't quite understand.
 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] Re: Installing GD library

2004-05-07 Thread Curt Zirzow
* Thus wrote Aaron Wolski ([EMAIL PROTECTED]):
 Now... what about installing for Linux?
 
 Any ideas? :)

./configure --help | grep GD

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: auto saving data in forms

2004-05-07 Thread Kim Steinhaug
Well shouldnt be a problem.

Hook up an iframe on your page, use a javascript timer to send all data
to the iframe every n seconds and submit the form inside the iframe.
This will give the user a perfect workflow in the window he is working in,
since the refreshing and such is done inside the iframe (which can be
hidden),

Sure you could use javaapplets and such, but there really shouldnt be any
need
for it.

Surely such an autosave function shoudl use a temp database /table to store
the data,
just as word uses temp files for autosaves.

Have fun!

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

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 i'm currently designing a website in which i have some forms with data
saved in
 database.

 My customer wants that when he add or modify some datas in these forms,
changes
 will be made immediately in database. I really don't know how to do it and
don't
 know if it is possible.

 Is there anyone who have fijnd a solution to solve that problem and who
can help
 me. I accept solutions in other langages than PHP like JAVA + XML.

 thanks,

 Marc

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



RE: [PHP] Re: Installing GD library

2004-05-07 Thread Matt Babineau
Installing GD for Linux can be a little more challanging:

If you are running red had here are a few things you will probably need:

RPMS:
Zlib
Zlib-devel
Libjpeg
Libjpeg-devel
GD (comes with php  4.3.0)

I think that was all I needed.

Then when you compile php try something like this:

./configure  --with-mysql --with-apxs=/usr/local/apache/bin/apxs --with-gd
--with-zlib-dir=/usr/include --enable-sockets

You can optionally add --with-jpeg and
--with-jpeg-dir=/wherever-libjpeg-got-installed

That's a basic install guild for GD on linux for use with PHP...I may not be
100% correct its been a while and I just woke up but that's the nutshell
verion.

Matt

-Original Message-
From: Aaron Wolski [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 07, 2004 11:56 AM
To: 'Kim Steinhaug'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Installing GD library

Now... what about installing for Linux?

Any ideas? :)

Aaron

 -Original Message-
 From: Kim Steinhaug [mailto:[EMAIL PROTECTED]
 Sent: May 7, 2004 2:57 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Installing GD library
 
 put the DLL file in your PHP DLL file directory, uncomment the line in 
 php.ini referring to it.
 
 Restart apache if running, IIS doesnt need to be restarted.
 
 --
 --
 Kim Steinhaug
 --
 There are 10 types of people when it comes to binary numbers:
 those who understand them, and those who don't.
 --
 www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
 --
 
 Phpu [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Hi,
 I've downloaded the GD library. Can someone tell me how do i install
it on
 a
 windows system?
 I found in internet a few articles but  i don't quite understand.
 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Installing GD library

2004-05-07 Thread Petr U.
On Fri, 7 May 2004 14:55:40 -0400
Aaron Wolski [EMAIL PROTECTED] wrote:

  Now... what about installing for Linux?
  

./configure  make install ? ;-P

GD is bundled in PHP, nothing special isn't needed to make it working. If
you're using some package manager from your distribution, install something
like php-VER-gd.ext and/or uncomment line in php.ini that is about loading GD
module (if GD isn't linked directly into PHP)

-- 
Petr U.

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



[PHP] Re: form submission logic

2004-05-07 Thread Torsten Roehr
Kim Steinhaug [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Well,

 I would include another hidden field and name it something like ACTION.
 I would also include a checkbox on every item you want to do something
with
 like this :

 input type=checkbox name=item[] value=?=$databaseID?

 Then use javascript on your actions to set the action to whatever mode you
 need, for example delete. On the PHP side you get a very nice workflow
now, as
 you will recieve an array on all the items which are selected and you can
 perform multiple tasks at once. Example, publish n articles in one go, or
delete all
 at once.

I would not recommend using Javascript here because then you are reliant on
the client having JS enabled. Just use different names for your submit
buttons and then check them:

if (isset($_POST['new'])) {
...
} elseif (isset($_POST['delete'])) {
...
}

...and so on

Regards, Torsten


 Remember to valiudate the $_POST[item] as an array! Remember, all the
 values
 in this array will be the onces you should $_POST[action].

 Have fun!

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

 Aaron Wolski [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi all,
 
  Was wondering if someone had any idea's on this logic and if it'd work,
  before I tried to implement it:
 
  Within the form/form tags I have my buttons - Publish, Unpublish,
  New, Edit and Delete.
 
  Next I have a table of that displays a list of records from a database
  with a checkbox to select a particular record.
 
  Once a record has been selected they click one of the top buttons to
  perform their desired action.
 
  WILL this work OR do the buttons HAVE to go at the bottom?
 
  Thanks! Any help is appreciated.
 
  Regards,
 
  Aaron
 
 

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



[PHP] next?

2004-05-07 Thread Maxi Yedid
Hello

I have products with category number (as a field in the same table).

A user can access any category, and he gets a list of products under that
cat.

What I want is, when the user enters a product, to have a next link that
would allow him to pass to the next record in that selection.

is that possible?

thanks

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



Re: [PHP] php_admin values solution

2004-05-07 Thread Tim Traver
Curt,

This is an apache module that dynamically determines the data directories 
for a particular incoming request based upon the Host header.

After that directory is determined, then I set the admin value of things 
like open_basedir for php.

This prevents me from having to make an entry for every virtual host in the 
config file. As long as the directory exists, then apache will serve it up...

Tim.



At 11:46 AM 5/7/2004, Curt Zirzow wrote:
* Thus wrote Tim Traver ([EMAIL PROTECTED]):
 Just in case anyone wants to know the solution, I found one on the apache
 list...

 Apparently, from within an apache module, one can use the function

 zend_alter_ini_entry(open_basedir, 13, path, strlen(path), 4, 16);
I am curious as why you want to make a module to have it override
admin set settings in php userland.  There is a reason why admin
values are set.
Curt
--
I used to think I was indecisive, but now I'm not so sure.
--
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] please remove this user

2004-05-07 Thread Tim Traver
Uhhh...I shouldn't have to do that...

and admin on this list should be able to remove those two offending 
addresses, right ?

Tim.

At 11:18 AM 5/7/2004, John Nichel wrote:
Tim Traver wrote:
Can any admin remove this user from the list ?
Advance Credit Suisse Bank [EMAIL PROTECTED]
Every time I post, I get an autoresponse from that address...
Anyone else get that ?
Thanks,
Tim.
Send it to /dev/null (or make a filter for it in your mail client).

--
John C. Nichel
KegWorks.com
716.856.9675
[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] Header() and POST data

2004-05-07 Thread Chris Shiflett
--- Todd Cary [EMAIL PROTECTED] wrote:
 I need to go to another page and I use the
 
 header(location:  . $the_url_to_the_page);
 
 Is it possible to use this method with POST so that the info does
 not show in the URL?

No, which is a very Good Thing.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] please remove this user

2004-05-07 Thread John Nichel
Tim Traver wrote:
Uhhh...I shouldn't have to do that...

and admin on this list should be able to remove those two offending 
addresses, right ?

Tim.

At 11:18 AM 5/7/2004, John Nichel wrote:

Tim Traver wrote:

Can any admin remove this user from the list ?
Advance Credit Suisse Bank [EMAIL PROTECTED]
Every time I post, I get an autoresponse from that address...
Anyone else get that ?
Thanks,
Tim.


Send it to /dev/null (or make a filter for it in your mail client).
They should, but we've asked for it to be done for a month or so now, 
so..

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] I need to hire someone to secure script

2004-05-07 Thread Chris Shiflett
--- doug_hastings [EMAIL PROTECTED] wrote:
 I wrote a script for my site which has been compromised repeatedly.
 I would like to hire someone to fix it for me. The script is about
 120 lines, nothing fancy. It needs at least an escapeshellcmd() and
 I am open to suggestions for security fixes.

I occasionally perform security audits for good causes or good money. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] please remove this user

2004-05-07 Thread Curt Zirzow
* Thus wrote Tim Traver ([EMAIL PROTECTED]):
 Uhhh...I shouldn't have to do that...
 
 and admin on this list should be able to remove those two offending 
 addresses, right ?

Yes and no.

In most cases it's possible.

But I could set up and email account to recieve posted messages and
then send out an email to the person who posted.  In this case, you
have no clue what email subcribed to the list, is sending out
messages. The best thing to do is report them to their provider.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: form submission logic

2004-05-07 Thread Kim Steinhaug
I dont agree however, if your creating a system which should be
user friendly I would absolutely demand from my users to have JS
enabled.

If they dont have JS enabled, then - well, to bad for them...

We have created several web applications and have alot of
customers (B2B), and they have all JS enabled. The friendslyness
and functionality you can do with JS makes the total experience
far better than not using JS. And you alse can save alot of reloading
of the pages with confirmation dialogs and such.

Anyway, its all a matter of opinion.

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

Torsten Roehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Kim Steinhaug [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Well,
 
  I would include another hidden field and name it something like
ACTION.
  I would also include a checkbox on every item you want to do something
 with
  like this :
 
  input type=checkbox name=item[] value=?=$databaseID?
 
  Then use javascript on your actions to set the action to whatever mode
you
  need, for example delete. On the PHP side you get a very nice workflow
 now, as
  you will recieve an array on all the items which are selected and you
can
  perform multiple tasks at once. Example, publish n articles in one go,
or
 delete all
  at once.

 I would not recommend using Javascript here because then you are reliant
on
 the client having JS enabled. Just use different names for your submit
 buttons and then check them:

 if (isset($_POST['new'])) {
 ...
 } elseif (isset($_POST['delete'])) {
 ...
 }

 ...and so on

 Regards, Torsten

 
  Remember to valiudate the $_POST[item] as an array! Remember, all the
  values
  in this array will be the onces you should $_POST[action].
 
  Have fun!
 
  --
  --
  Kim Steinhaug
  --
  There are 10 types of people when it comes to binary numbers:
  those who understand them, and those who don't.
  --
  www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
  --
 
  Aaron Wolski [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   Hi all,
  
   Was wondering if someone had any idea's on this logic and if it'd
work,
   before I tried to implement it:
  
   Within the form/form tags I have my buttons - Publish, Unpublish,
   New, Edit and Delete.
  
   Next I have a table of that displays a list of records from a database
   with a checkbox to select a particular record.
  
   Once a record has been selected they click one of the top buttons to
   perform their desired action.
  
   WILL this work OR do the buttons HAVE to go at the bottom?
  
   Thanks! Any help is appreciated.
  
   Regards,
  
   Aaron
  
  

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



Re: [PHP] please remove this user

2004-05-07 Thread David T-G
Curt, et al --

...and then Curt Zirzow said...
% 
...
% messages. The best thing to do is report them to their provider.

I've been sending these (initially forwarded with a this mailbox is an
autoresponder that generates this message on the list preamble and then
just redirected) to root/abuse/postmaster at credit suisse and astral,
and now also to the domain contacts (interestingly enough, both look to
have registered through ipowerweb although the owners appear quite
unrelated) for a few weeks now.

Perhaps it's time to start calling ipowerweb at 888/511-4678 to encourage
them to help these clients fix their broken configurations (be they on an
ipower virtual server or within a corporate network).  Then, again, astral
is due to expire late next month; perhaps it really will!

Hey, I guess I'll have two more messages to fire off in about a minute :-)


HTH  HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Re: form submission logic

2004-05-07 Thread Torsten Roehr
Kim Steinhaug [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I dont agree however, if your creating a system which should be
 user friendly I would absolutely demand from my users to have JS
 enabled.

This is only possible in a non-public application.


 If they dont have JS enabled, then - well, to bad for them...

 We have created several web applications and have alot of
 customers (B2B), and they have all JS enabled. The friendslyness
 and functionality you can do with JS makes the total experience
 far better than not using JS. And you alse can save alot of reloading
 of the pages with confirmation dialogs and such.

I agree with you that it *may* improve usability - but in Aaron's case it is
of no interest to the user how the application prepares and checks the form
actions - and this can be done perfectly without JS here. Also - and you
can't deny this - Javascript always adds a bit of uncertainty as not all
browsers interpret every function in the same way.


 Anyway, its all a matter of opinion.

Absolutely ;)

I just wanted to tell Aaron that a more complicated/sophisticated way is not
always better and to carefully balance if Javascript is *really* need here.

No offence to you, though...

Torsten


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

 Torsten Roehr [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Kim Steinhaug [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   Well,
  
   I would include another hidden field and name it something like
 ACTION.
   I would also include a checkbox on every item you want to do something
  with
   like this :
  
   input type=checkbox name=item[] value=?=$databaseID?
  
   Then use javascript on your actions to set the action to whatever mode
 you
   need, for example delete. On the PHP side you get a very nice
workflow
  now, as
   you will recieve an array on all the items which are selected and you
 can
   perform multiple tasks at once. Example, publish n articles in one go,
 or
  delete all
   at once.
 
  I would not recommend using Javascript here because then you are reliant
 on
  the client having JS enabled. Just use different names for your submit
  buttons and then check them:
 
  if (isset($_POST['new'])) {
  ...
  } elseif (isset($_POST['delete'])) {
  ...
  }
 
  ...and so on
 
  Regards, Torsten
 
  
   Remember to valiudate the $_POST[item] as an array! Remember, all
the
   values
   in this array will be the onces you should $_POST[action].
  
   Have fun!
  
   --
   --
   Kim Steinhaug
   --
   There are 10 types of people when it comes to binary numbers:
   those who understand them, and those who don't.
   --
   www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
   --
  
   Aaron Wolski [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
Hi all,
   
Was wondering if someone had any idea's on this logic and if it'd
 work,
before I tried to implement it:
   
Within the form/form tags I have my buttons - Publish,
Unpublish,
New, Edit and Delete.
   
Next I have a table of that displays a list of records from a
database
with a checkbox to select a particular record.
   
Once a record has been selected they click one of the top buttons
to
perform their desired action.
   
WILL this work OR do the buttons HAVE to go at the bottom?
   
Thanks! Any help is appreciated.
   
Regards,
   
Aaron
   
   

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



Re: [PHP] Returning an object

2004-05-07 Thread Aidan Lister

Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 * Thus wrote Aidan Lister ([EMAIL PROTECTED]):
  How _should_ this be done? In terms of best practice.
 
  ?php
  function foobar ()
  {
  return new SomeObject;
  }
  ?
 
  Or:
 
  ?php
  function barfoo ()
  {
  $tempvar = new SomeObject;
  return $tempvar
  }
  ?

 I'm not exactly sure what your looking for, this is like asking
 what is better:

   $a = 'foo';
   echo $a;

   or
   echo 'foo';

 if tou want my opinion it should be written like this:
 ?php

 /*
  * Create an instance of SomeObject
  */
 function foobar() {
   return new SomeObject;
 }



  Please don't reply if you really, really don't know what you are talking
  about.

 What kind of requirement is this? Anyone can reply your email and
 they will do so if they feel like it.


The reason I added that at the bottom was to stop people like yourself
replying, not that I don't appreciate your advice, I think you're simply not
aware of the facts.


 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Re: Returning an object

2004-05-07 Thread Aidan Lister
I found some more information about it here:
http://bugs.php.net/bug.php?id=24687

It looks like you should assign an object to a variable before returning it.


Justin Patrin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Aidan Lister wrote:

  How _should_ this be done? In terms of best practice.
 
  ?php
  function foobar ()
  {
  return new SomeObject;
  }
  ?
 
  Or:
 
  ?php
  function barfoo ()
  {
  $tempvar = new SomeObject;
  return $tempvar
  }
  ?
 
  Please don't reply if you really, really don't know what you are talking
  about.

 Some earlier versions of PHP5 would not allow returning by reference of
 a function call or a new call. It was very recently added, but may not
 be in RC2 (not sure). You had to assign to a variable before you returned.

 Here's my 2c:

 function foobar() {
return new SomeObject;
 }

 -- 
 paperCrane Justin Patrin

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



[PHP] Re: Recommend an IDE for Windows

2004-05-07 Thread Rainer Müller
Chris Lott wrote:
I already use and am happy with a variety of text editors (vim, emacs,
ultraedit, jedit, Homesite) depending on my needs, but I would like
recommendations for a PHP specific IDE that will run on Windows XP.
Specifically I am looking for something that can help with debugging,
provides efficient code browsing (functions, objects, etc) across multiple
files in a project, easy browsing through proper mappings to a development
server/local server, and hooks to PHP reference/help/website.
Needless to say, standard features like syntax highlighting, block
formatting, etc. are a requirement.
I've been looking at Zend Studio and Nusphere PHPEd as primary candidates.
However, I have a short window to buy something (fiscal year issues) so any
comments on these two editors (separately or in comparison to one another)
or other tools I should be looking at would be greatly appreciated!
c
--
Chris Lott chris.lott[AT]gmail.com
http://www.phpedit.net - It's still free, but the license model will 
change soon AFAIK.

Rainer

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


Re: [PHP] Returning an object

2004-05-07 Thread Curt Zirzow
* Thus wrote Aidan Lister ([EMAIL PROTECTED]):
 
 Curt Zirzow [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  * Thus wrote Aidan Lister ([EMAIL PROTECTED]):
  ...
 
 
   Please don't reply if you really, really don't know what you are talking
   about.
 
  What kind of requirement is this? Anyone can reply your email and
  they will do so if they feel like it.
 
 
 The reason I added that at the bottom was to stop people like yourself
 replying, not that I don't appreciate your advice, I think you're simply not
 aware of the facts.
 
the birds and bees? sure I know about them... and again you're
being vague on what facts your refering to.


Curt 
-- 
I was working on a flat tax proposal, and I accidentally proved there's
no god.

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



[PHP] page_title

2004-05-07 Thread Erik Gjertsen
I have write following code:
?php
$page_title = Welcome;
?

But I can not see Welcome on top of the page.
Can someone tell me why I not can see it?

Thanks
Erik Gjertsen

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



  1   2   >