RE: [PHP] Destroying session data

2004-12-23 Thread Vail, Warren
Closing the browser sends nothing to the webserver and with most webservers,
the server has forgotten that you were ever there.

When using sessions, you connect your browser and request a page, and that
request is accompanied with a session key that is stored in a cookie on the
browser machine by domain.  PHP takes it on faith that IF this cookie comes
with the request, it should match a session datastore, and it looks, and if
it finds one, it uses that session when the session_start() function is
called (now it remembers you, so to speak).

As the script wraps up the session datastore is updated with any new session
data, using a probability factor set in php.ini, it may do some extra
processing to cleanup old expired sessions.  Since the page has already
been transmitted in it's entirety to the browser, and the browser should now
be working to render the page, this extra process should have no noticeable
impact on the user experience.  This Garbage Cleanup routine will scan the
entire datastore looking for session records that are older than allowed by
another php.ini parameter (gc_maxlifetime), and removes them (gc stands for
Garbage Cleanup).  Keep in mind that this garbage collection will probably
not remove the session that pertain to the browser that triggers the
cleanup, but rather it will remove session records for other sessions that
have not been referenced for a while.

In php you can write your own session management handler routines and attach
them to your php process.  Check out some of the following;

http://us4.php.net/manual/en/ref.session.php
http://us4.php.net/manual/en/function.session-set-save-handler.php

Studying these routines can teach you a lot about how sessions work.

If you can get your users to log out instead of closing their browser, you
have a chance to execute a script that will then kill a session and that
usually removes an individual session data record.

HTH,

Warren Vail


 -Original Message-
 From: Philip Thompson [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 23, 2004 12:45 PM
 To: php-general@lists.php.net
 Subject: [PHP] Destroying session data
 
 
 Hi all.
 
 I have multiple pages on a website that uses sessions ($_SESSION) to 
 store the data. However, I noticed that in the C:\Windows\Temp 
 directory, all the session variables/data files are stored there from 
 previous (and current) sessions.
 
 My question is: when the session is logged out or ended 
 (via closing 
 the browser or however), should these data files (which look like 
 sess_fd983aedf93ceeioa8332890bcd, etc) not be destroyed? If not, is 
 there a way to automatically destroy them because I don't 
 want to have 
 to go in each day/week/month and delete these session data files 
 manually? Are these data files considered to be cookies?
 
 Just to clarify, I know how to destroy session variables... I want to 
 know how to destroy the files that contain those variables after 
 they're no longer being used. I have RTFM and I can't seem to 
 find the 
 answer.
 
 Thanks in advance,
 ~Philip
 
 -- 
 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] Destroying session data

2004-12-23 Thread Vail, Warren
 
 Okay, lemme see if I understand how it works. Even if it sees it as 
 garbage, it will not destroy it until the session has ended? or will 
 destroy when that time is reached? So can I set 
 session.gc_maxlifetime 
 to be a low number (e.g., 10 seconds) and it will still behave 
 appropriately? Currently, it's set to the default - 1440.
 
Actually the way most garbage cleanup routines work, the session datastore
will be removed regardless of whether it is in use or not.  

Here comes the tricky stuff, if php has sent a page to the browser and has
satisfied your browsers request, and your user is reviewing the contents of
the page to decide his next action, as far as apache and php are concerned,
that users session is no longer in use.  But, if in the process of
preparing that page, it was using sessions, it would have stamped the
session datastore with a new timestamp, so the garbage cleanup routine would
not consider it an old datastore and remove it.  If the user waits a long
time (longer than gc_maxlifetime in seconds) before doing something, when
someone else requests a page, their session could trigger a cleanup process
and your session could be deleted.

If your script is running, fetches the session datastore, and has not
reached the end of it's processing where it rewrites the datastore with
updated data and a new timestamp, if during that time the file is deleted,
no harm done since the save session routine of your script will make sure
the datastore is created and write stuff back into if from it's memory
image.  I guess that is what PHP would consider in use, whereas your user
will consider the time he is mulling over his response as in use, even if
he gets up to get a cup of coffee before responding.

Warren Vail

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



RE: [PHP] hackers?

2004-12-22 Thread Vail, Warren
 
 not sure if this is a stupid question,
 but im looking for a person or a place that will check or try 
 to break a site.
 
Does sound a little like walking into a tough bar with a gun looking for
someone to shoot you, but while I would be tempted to lurk around these
guy's a little to figure out who could do the work, I would probably start
lurking at;

http://www.zone-h.org

Perhaps reading on their hall of fame Top Attackers.  This is where I went
when a couple of my sites were hacked.

Lots of good info on this site if you are just looking for info on
vulnerabilities.

Be Careful,

Warren Vail


 

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



RE: [PHP] User Groups Mailing List

2004-12-17 Thread Vail, Warren
http://www.meetup.com is a website that has been around a couple of years at
least, and provides lots of organization tips for groups interested in most
subject and yes there is a whole series of them oriented around PHP, and I
believe another around MySQL.  Promote, promote, promote, seems to be the
word(s) for the day.

Warren Vail


 -Original Message-
 From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 17, 2004 9:58 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] User Groups Mailing List
 
 
 --- Richard Lynch [EMAIL PROTECTED] wrote:
  Is there any interest in a PHP mailing list for User Groups?
 
 Yep. :-)
 
 http://lists.nyphp.org/mailman/listinfo/phpm
 
 That list consists of several user group leaders, company 
 representatives (mainly book and magazine publishers), and 
 other notable community members.
 
  I'm thinking topics along the lines of:
  Forming a User Group
  Promoting a User Group
  TipsTricks for increasing attendance and the quality of meetings
  
  Perhaps sharing/swapping resources, recommending speakers.
  
  Posts by experts who are traveling and want to hook up with a User 
  Group to show off their latest PHP work/technology.
  
  I'd be happy to moderate such a list, and could find some 
 kind of host 
  for it if PHP.net is not willing/suitable/able to do so.
  
  I know I've had many challenges to keep the Chicago User 
 Group going 
  and suspect many people could benefit from this sort of list.
 
 Having another founder on the list would certainly be 
 helpful, if you're interested in contributing. Eventually, we 
 want to have much more than a mailing list, however - we'd 
 like to create a resource as useful as Perl Mongers.
 
 Chris
 
 =
 Chris Shiflett - http://shiflett.org/
 
 PHP Security - O'Reilly HTTP Developer's Handbook - Sams
 Coming Soon http://httphandbook.org/
 
 -- 
 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] GD, problem adding text to GIF images

2004-12-16 Thread Vail, Warren
I believe that is the nature of GIF images, I seem to recall they were very
compact but limited to a maximum of 16 colors (or 32 or some number like
that[maybe 64]), fewer colors that JPEG.  Anyone know exactly?

Warren Vail


 -Original Message-
 From: Juan Nin [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 16, 2004 10:20 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] GD, problem adding text to GIF images
 
 
 Hi,
 
 I'm adding text to images using the native gd in PHP 4.3.9
 
 I have no problems with jpg images, but with gif ones, the 
 colour of the text added to the image always results a dark 
 grey The image itself and text are fine, but not the colour, 
 which should be white..
 
 Has anyone experienced this problem?
 
 Used functions are:
 
 
   imagecreatefromgif
   imagettftext
   imagegif
 
 
 Thanks in advance,
 
 Juan
 
 -- 
 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] grabbing source of a URL

2004-12-10 Thread Vail, Warren
I suspect that you don't really want to cut out everything but the text
(since you plan to display it) but check out;

http://us2.php.net/manual/en/function.strip-tags.php

Now, keep in mind that since you are getting the source from the url, and
I'm guessing that the web server serving up the source will process php
files, this function will probably never see any php in that case, so when
you said a URL's source you must have meant html source generated by a
php program.

Warren Vail


 -Original Message-
 From: Adam Williams [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 10, 2004 9:56 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] grabbing source of a URL
 
 
 Hi, I don't know what functions to use so maybe someone can 
 help me out.  
 I want to grab a URL's source (all the code from a link) and 
 then cut out 
 a block of text from it, throw it away, and then show the page.
 
 For example, if I have page.html with 3 lines:
 
 htmlheadtitlehi/title/head
 body
 !-- line a --
 this is line a
 !-- end line a --
 !-- line b --
 this is line b
 !-- end line b --
 !-- line c --
 this is line c
 !-- end line c --
 /body/html
 
 i want my php script to grab the source of page.html, strip out:
 
 !-- line a --
 this is line a
 !-- end line a --
 
 and then display what is left, how would I go about doing 
 this?  I don't 
 know what function to use to grab the page.  for the string 
 to remove, I 
 know I can probably do a str_replace and replace the known code with 
 nothing.
 
 -- 
 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] grabbing source of a URL

2004-12-10 Thread Vail, Warren
Oops missed part of your question;

 know what function to use to grab the page.  for the string 

http://us2.php.net/manual/en/function.fopen.php

There are some good samples on the page

   $dh = fopen($url,'r'); 
   $result = fread($dh,8192);

Hope this is what you need.

Warren Vail


 -Original Message-
 From: Adam Williams [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 10, 2004 9:56 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] grabbing source of a URL
 
 
 Hi, I don't know what functions to use so maybe someone can 
 help me out.  
 I want to grab a URL's source (all the code from a link) and 
 then cut out 
 a block of text from it, throw it away, and then show the page.
 
 For example, if I have page.html with 3 lines:
 
 htmlheadtitlehi/title/head
 body
 !-- line a --
 this is line a
 !-- end line a --
 !-- line b --
 this is line b
 !-- end line b --
 !-- line c --
 this is line c
 !-- end line c --
 /body/html
 
 i want my php script to grab the source of page.html, strip out:
 
 !-- line a --
 this is line a
 !-- end line a --
 
 and then display what is left, how would I go about doing 
 this?  I don't 
 know what function to use to grab the page.  for the string 
 to remove, I 
 know I can probably do a str_replace and replace the known code with 
 nothing.
 
 -- 
 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] ISP snippet

2004-12-09 Thread Vail, Warren
I can't help but wonder if an ip trace rte could be used to help identify
the ISP?  Or Perhaps using a whois,,, doesn't some versions of whois use IP
address?  Intriguing question,,,

Warren Vail

 -Original Message-
 From: John Nichel [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 09, 2004 5:04 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] ISP snippet
 
 
 Brad Ciszewski wrote:
  i need help to figure out the isp of a user. can anyone 
 help me with 
  this?
 
 Maybe you can ask the user real nice.
 
 -- 
 By-Tor.com
 ..it's all about the Rush
 http://www.by-tor.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP] FCK Editor

2004-12-07 Thread Vail, Warren
There is another similar editor called htmlarea.

http://www.interactivetools.com/freescripts/

My impression was that htmlarea might be a little more extensible. (Image
manager, Table Managers, Multiple languages, etc).

Warren Vail


 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 07, 2004 5:12 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] FCK Editor
 
 
 Hey all,
 I came accross this free dhtml editor while browsing the net 
 for popular projects, anybody else using FCK Editor? If yes, 
 any problems? if no, heres the url 'case you want to check it out
 yourself: http://www.fckeditor.net/
 
 Cheers,
 Ryan
 
 
 
 -- 
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.289 / Virus Database: 265.4.6 - Release Date: 12/5/2004
 
 -- 
 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] FCK Editor

2004-12-07 Thread Vail, Warren
Sure, I added it to a PHPNuke site (among others).  Check out

http://www.phppilot.com/nuke/html/modules.php?name=Submit_News


Warren Vail

 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 07, 2004 10:56 AM
 To: Vail, Warren
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] FCK Editor
 
 
 Hey,
 Thanks for replying.
 
 Sounds good, have you used it yourself in any real life 
 projects? or extended it in any way?
 
 Cheers,
 Ryan
 
 On 12/7/2004 7:29:07 PM, Vail, Warren ([EMAIL PROTECTED]) wrote:
  There is another similar editor called htmlarea. 
  http://www.interactivetools.com/freescripts/
  My impression was that htmlarea might be a little more extensible. 
  (Image manager, Table Managers, Multiple languages, etc). 
 Warren Vail
 
 
 
 
 
   -Original Message-
 
   From: Ryan A [mailto:[EMAIL PROTECTED]
 
   Sent: Tuesday, December 07, 2004 5:12 AM
 
   To: [EMAIL PROTECTED]
 
   Subject: [PHP] FCK Editor
 
  
 
  
 
   Hey all,
 
   I came accross this free dhtml editor while browsing the net
 
   for popular projects, anybody else using FCK Editor? If yes,
 
   any problems? if no, heres the url 'case you want to check it out
   yourself: http://www.fckeditor.net/
  
   Cheers,
   Ryan
  
  
  
   --
   No virus found in this outgoing message.
   Checked by AVG Anti-Virus.
   Version: 7.0.289 / Virus Database: 265.4.6 - Release 
 Date: 12/5/2004
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.
 
 
 
 -- 
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.289 / Virus Database: 265.4.6 - Release Date: 12/5/2004
 

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



RE: [PHP] FCK Editor

2004-12-07 Thread Vail, Warren
I believe they this particular editor uses a html rendering and editing
control that is a part of IE and windows (probably .net, but not sure).
Probably won't work in these other browsers, because they are committed to
their own editor.  If you don't have IE, then you are stuck with the
textarea and coding your own html.  I know this list includes lots of
individuals who like to remain off the beaten path (sometimes myself), but
you sometimes pay a price for that.

http://www.phpnuke.org/modules.php?name=Statistics

PHP Nuke's statistics page shows percentages of visits using various
editors, you may find interesting.

Good luck,

Warren Vail

 -Original Message-
 From: Afan Pasalic [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 07, 2004 11:10 AM
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] FCK Editor
 
 
 Just checked and it doesn't work on my Firefox 1.0 nor 
 Netscape 7.1. On IE works just fine. Guys from 
 InteractiveTools buit beta version 3 that covers most of 
 browsers (didn't check/use).
 FCKeditor has some bugs on FireFox as well. Didn't check on Netscape.
 
 -afan
 
 
 Vail, Warren wrote:
 
 Sure, I added it to a PHPNuke site (among others).  Check out
 
 http://www.phppilot.com/nuke/html/modules.php?name=Submit_News
 
 
 Warren Vail
 
   
 
 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 07, 2004 10:56 AM
 To: Vail, Warren
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] FCK Editor
 
 
 Hey,
 Thanks for replying.
 
 Sounds good, have you used it yourself in any real life
 projects? or extended it in any way?
 
 Cheers,
 Ryan
 
 On 12/7/2004 7:29:07 PM, Vail, Warren 
 ([EMAIL PROTECTED]) wrote:
 
 
 There is another similar editor called htmlarea.
 http://www.interactivetools.com/freescripts/
 My impression was that htmlarea might be a little more extensible. 
 (Image manager, Table Managers, Multiple languages, etc). 
   
 
 Warren Vail
 
 
 
 
 
   
 
 -Original Message-
 
 
 From: Ryan A [mailto:[EMAIL PROTECTED]
 
 
 Sent: Tuesday, December 07, 2004 5:12 AM
 
 
 To: [EMAIL PROTECTED]
 
 
 Subject: [PHP] FCK Editor
 
 
 Hey all,
 
 
 I came accross this free dhtml editor while browsing the net
 
 
 for popular projects, anybody else using FCK Editor? If yes,
 
 
 any problems? if no, heres the url 'case you want to check it out
 yourself: http://www.fckeditor.net/
 
 Cheers,
 Ryan
 
 
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.289 / Virus Database: 265.4.6 - Release
 
 
 Date: 12/5/2004
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.
 
 
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.289 / Virus Database: 265.4.6 - Release Date: 12/5/2004
 
 
 
 
   
 
 
 -- 
 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] FCK Editor

2004-12-07 Thread Vail, Warren
Ah yes, I had fogotten, I did write that code myself to limit it to IE and
my modifications have not been updated for a while.  You might checkout the
source site for htmlarea to see about compatibility.

http://www.htmlarea.com/

I suppose if it had more capability, it probably wouldn't be free, and that
would be a shame.

Warren Vail


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 07, 2004 11:37 AM
 To: [EMAIL PROTECTED]
 Cc: Vail, Warren
 Subject: RE: [PHP] FCK Editor
 
 
 It worked on my IE and I don't have .NET Framework installed, 
 so guess it's not a .NET specific thing.  Did not work on my 
 Firefox (as it was advertised not to).  I havn't looked at 
 the code, but it's not a matter of the module doing a browser 
 detect and 'downshifting' if it didn't detect a genuine IE 
 browser is it?
 
 Firefox and the other big name browsers can do most of what 
 IE can do, but I can still see that some internal controls 
 might be outside of their reach.  Just a thought.
 
 -TG
 *** new email address   [EMAIL PROTECTED]
 *** old email address   [EMAIL PROTECTED] (dead)
 
 = = = Original message = = =
 
 I believe they this particular editor uses a html rendering 
 and editing control that is a part of IE and windows 
 (probably .net, but not sure). Probably won't work in these 
 other browsers, because they are committed to their own 
 editor.  If you don't have IE, then you are stuck with the 
 textarea and coding your own html.  I know this list includes 
 lots of individuals who like to remain off the beaten path 
 (sometimes myself), but you sometimes pay a price for that.
 
 http://www.phpnuke.org/modules.php?name=Statistics
 
 PHP Nuke's statistics page shows percentages of visits using 
 various editors, you may find interesting.
 
 Good luck,
 
 Warren Vail
 
 
 ___
 Sent by ePrompter, the premier email notification software. 
 Free download at http://www.ePrompter.com.
 

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



RE: [PHP] Random data loss.

2004-12-06 Thread Vail, Warren
Could be a problem of multiple update modules for the same table.  When I've
encountered this problem in the past it's been one of two causes.

1.  In the process of maintaining the table one routine that has no price
information, retrieves the row and notices that the something needs to be
changed, and instead of only updating columns that have changed it seeks to
update all of them (perhaps satisfying one programmers sense of order), and
since it has no price info, it replaces the price with zero (good rule IMHO;
only update columns that you know need to be changed).

2.  Update queries that did not specify all the appropriate where clauses,
thereby updating multiple rows, and perhaps in this case updating with zero
prices (perhaps contributed to by coding all elements as above).  (a rule
that I apply to myself, not necessarily quite as good as the previous rule,
use artificial keys [auto increment fields] and update with unique [or a
list of] artificial key in the where clause).  One nice thing about auto
increment primary keys is they are self locking in that no two insert rows
can get the same artificial key, even if the insert occurs at the same time
(at least in MySQL).  Take a look at the text in your actual queries and
read them over and over, the answer is there.

Don't consider this an exhaustive list, there are lots of people out there
more clever than I coming up with new ways to loose data every day.  But
this is where I would start.

Hope this helps,

Warren Vail

 -Original Message-
 From: 2wsxdr5 [mailto:[EMAIL PROTECTED] 
 Sent: Monday, December 06, 2004 4:27 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Random data loss.
 
 
 With out posting any code I was wondering if anyone here has been 
 experiencing this kind of problem.  I have a standard web 
 from that PHP 
 code then reads and saves the data into a MySQL DB.  The 
 problem is some 
 of my users have had data lost somewhere in this process.  
 The web site 
 is www.thewishzone.com.  It is a wish list site and the data 
 that seems 
 to be getting lost is the price of an item a user adds to their wish 
 list.  I can't seem to duplicate it here.  However one user 
 did have it 
 happen twice in a short time period.  They enter a valid 
 price and after 
 the record posts the price goes to zero.  Any ideas?
 
 Chris W
 
 Gift Giving Made Easy
 Get the gifts you want  give the
 gifts they want this holiday season
 http://thewishzone.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP] getting the phsyical path

2004-12-03 Thread Vail, Warren
Another option would be to open the file with a http protocol reference.
PHP can access files specifying a URL, and if pointing to your current
domain it should work.

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

I.e. $fh = fopen(http://www.mydomain.com/filea.txt,r;);

You should also be able to get the hostname from the $_SERVER array,
depending on your web server

$_SERVER[HTTP_HOST] on my linux apache server.

Good luck,

Warren Vail


 -Original Message-
 From: John Nichel [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 11:56 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] getting the phsyical path
 
 
 Josh Howe wrote:
  Sorry if this is a dumb question. Is there a way in php to get the 
  physical path the document root of my website? I want to 
 open a file 
  in the root of my web server, i.e. /, but I won't always 
 know what 
  the physical path to the web root is, and it will vary depending on 
  the machine the web app is running on. I've tried using realpath 
  (e.g.
  realpath(/)) but it doesn't really work. Thanks.
  
  
 
 $_SERVER['DOCUMENT_ROOT']
 
 -- 
 John C. Nichel
 ÜberGeek
 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] Plz help me

2004-12-03 Thread Vail, Warren
Assuming you want to show the template file text contents and not have the
file translated in any way in the iframe, you might check out;

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

If on the other hand you just want to show the translated template,, then
you want to point your IFRAME to the correct URL for that (more of an html
issue).

Warren Vail


 -Original Message-
 From: suneel [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 1:00 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Plz help me
 
 
 Hi Every one...
 
 Straight to the topic...
 
 I have a template file called 
 welcome.tmp. I want to show the whole file in a Iframe with 
 dimensions of 250 x 250.(i.e., less dimensions ).
 
  Is it possible using PHP. Or how should I 
 approach to achieve this one.
 
 Thanks in advance.
 
 Sun.
 
 

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



RE: [PHP] Go Back Problem

2004-12-01 Thread Vail, Warren
If your php form is entered via a post, my experience is that most browsers
do not save post information, therefore, clicking back to a page that was
entered via a form using the post method, the browser complains that it does
not have enough information to display the form, and that you must retry or
something like that.  I have found that the simplest way to avoid this is
divide each page into two php routines.

Displaypage.php will check in session data for contents for the form, or
fetch the information from the database, then it will format the html for
the page with values from session variables or from the database.  The
action field of this form will specify the postform.php routine below.

Postform.php will perform all validations and echo nothing to the browser.
It will then either update session data or post the valid data to the
database.  The only output of this routine is a header sending the browser
back to the previous module displaypage.php when it has done all it can.
Notice that anytime you use a header to redirect the browser you can send
variables if you need to via the URL parameter list ?var1=1var2=2 string
(they show up in the $_GET array).  These variables are saved by all
browsers that I know about, which means your displaypage.php program is
never entered via a post (and always via a get), and because the redirect
comes from the postform.php page, the postform.php module is removed from
the browser history list by the redirect.  This means that every click of
the back button, or JavaScript history reference (-1) will take you back to
the previous entry in the history list and if you are consistent, none of
them will have been entered via a form post (i.e. no complaints).

Hope this was clearer than mud, good luck.

Warren Vail

 -Original Message-
 From: Cyrus [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, December 01, 2004 5:59 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Go Back Problem
 
 
 Dear All,
 
 I have a problem of back to the previous page in php.
 I need to create a form let people to fill in .It can let 
 user to preview the form, if information is not correct , 
 user can back to previous page and correct it,
 I have used the javascript  :  OnClick='history.go(-1)'   and 
  OnClick='history.back()'  in php , but it can not 
 workspls help me.
 
 Thanks and Regards,
 
 Cyrus Chan
 

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



RE: [PHP] Execution time?

2004-12-01 Thread Vail, Warren
Take a timestamp at the beginning or your script and at the end (subtract)
and you have the execution time (reasonably precisely) plus or minus a few
microseconds.

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

Warren Vail


 -Original Message-
 From: Peter Lauri [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, December 01, 2004 7:02 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Execution time?
 
 
 Best groupmember,
 
 How do I find the execution time for a php-script on a webserver? ms?
 
 --
 - Best Of Times
 /Peter Lauri
 
 -- 
 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] PHP mail redirect ??

2004-12-01 Thread Vail, Warren
 But I want a redirect button so I could send the exact same 
 message to 
 the same user and from the same person just but to another 
 mail box on a 
 different machine.

Not sure I've ever hear the term redirect used in reference to email.
Understand that email cannot be received on just any machine (there needs to
be a pop (or imap or smtp) deamon running on that machine.

But to answer you question, you can often send email to a specific machine
if you know the machine name in the following form;

[EMAIL PROTECTED] - but keep in mind that there needs to be a daemon
running on that machine AND there needs to be a mailbox for bert set up on
that server.

HTH 

Warren Vail

 -Original Message-
 From: Michael Gale [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, December 01, 2004 7:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP mail redirect ??
 
 
 Hello,
 
   I have been playing around with a web mail app called NOCC 
 (http://nocc.sourceforge.net/)
 
 It has some nice features and is quick.
 
 I want to add in a redirect button for mail, there is a 
 forward button 
 but it forwards mail just like a regular client for ... as expected.
 
 But I want a redirect button so I could send the exact same 
 message to 
 the same user and from the same person just but to another 
 mail box on a 
 different machine.
 
 Is there a easy to do this with out having to create some thing from 
 scratch.
 
 Thanks ..
 
 
 Michael.
 
 -- 
 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] PHP mail redirect ??

2004-12-01 Thread Vail, Warren
OK, now we are getting somewhere.  On my machines, this is referred to as an
email forwarder and yes SMTP handles it, however, I am not sure how you are
handling your spam detection.  On my servers I use spam assassin and it's
detection is not fool proof.  If people send images in their email with a
signature, spam assassin will sometimes miss identify their email as spam.

I would check the documentation for your spam filter for most of the
redirection you would like to do.

Warren Vail
(415) 667-0240
SF211-07-434
 


 -Original Message-
 From: Michael Gale [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, December 01, 2004 7:48 PM
 To: Vail, Warren; [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP mail redirect ??
 
 
 Hello,
 
   There is another smtp server ... I should of provided 
 more info ...
 
 
 I set up a postfix server to do the following:
 
 1. Receives mail from outside ...
 
 if it is NOT spam
 
 2. Virus scanned and then forward to exchange
 
 if it IS SPAM
 
 2. Sent to a virtual type mail box and virus scanned.
 
 
 This way users would never get mail that is considered SPAM in there 
 Exchange Inbox. Each morning they will get 1 e-mail containing a out 
 line of new mail in the virtual account that is considered spam. That 
 e-mail will be automatically deleted after 30 days.
 
 They can login via the web interface and download mail, 
 formail to them 
 selves only.
 
 I was hopping to add in a redirect type of feature where the e-mail 
 would get sent to their actual Inbox on Exchange and not look like it 
 was forwarded from the virtual account if the user clicks the 
 a button.
 
 Thanks for the reply.
 
 Michael.
 
 
 
 Vail, Warren wrote:
 But I want a redirect button so I could send the exact same
 message to 
 the same user and from the same person just but to another 
 mail box on a 
 different machine.
  
  
  Not sure I've ever hear the term redirect used in reference to 
  email. Understand that email cannot be received on just any machine 
  (there needs to be a pop (or imap or smtp) deamon running on that 
  machine.
  
  But to answer you question, you can often send email to a specific 
  machine if you know the machine name in the following form;
  
  [EMAIL PROTECTED] - but keep in mind that there needs to be a 
  daemon running on that machine AND there needs to be a mailbox for 
  bert set up on that server.
  
  HTH
  
  Warren Vail
  
  
 -Original Message-
 From: Michael Gale [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 01, 2004 7:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP mail redirect ??
 
 
 Hello,
 
 I have been playing around with a web mail app called NOCC
 (http://nocc.sourceforge.net/)
 
 It has some nice features and is quick.
 
 I want to add in a redirect button for mail, there is a
 forward button 
 but it forwards mail just like a regular client for ... as expected.
 
 But I want a redirect button so I could send the exact same
 message to 
 the same user and from the same person just but to another 
 mail box on a 
 different machine.
 
 Is there a easy to do this with out having to create some thing from
 scratch.
 
 Thanks ..
 
 
 Michael.
 
 --
 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] unlink images

2004-11-26 Thread Vail, Warren
PHP has wonderful capabilities to generate images on the fly, such that they
are never stored on disk, perhaps you should look into that as an option,
you could even make the code decide who should be able to see the image and
who should not.

http://www.php.net/manual/en/ref.image.php

Warren Vail


 -Original Message-
 From: Julian [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 26, 2004 11:14 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] unlink images
 
 
 Hello,
 I would like to delete a set of images right after they are 
 displayed on the 
 page using unlink. Unfortunately, with unlink the images are 
 deleted before 
 they display on the user's browser. Is there a way to do this?
 
 Thank you! 
 
 -- 
 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] $_POST['xxx'] = blabla ?

2004-11-22 Thread Vail, Warren
Because you can have more than one submit button per form?

Warren Vail

 -Original Message-
 From: Perry Jönsson [mailto:[EMAIL PROTECTED] 
 Sent: Monday, November 22, 2004 12:56 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] $_POST['xxx'] = blabla ?
 
 
 Gerhard Meier wrote:
  On Mon, Nov 22, 2004 at 09:38:00PM +0100, Perry Jönsson wrote:
  
 1. if ($_POST['submit'] == 'Login') { ... }
  
  
  This one is true if $_POST['submit'] is equal to 'Login'.
  
  
 2. if (isset($_POST['submit']) { ... }
  
  
  This one is true if $_POST['submit'] is set, it doesn't 
 matter which 
  value it has.
  
  /GM
 
 
 If you only have one form on a page, why would you like to check the 
 value/name of the submit button?
 
 Is there a security aspect to this?
 
 /PJ
 
 -- 
 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] PhP e COBOL

2004-11-19 Thread Vail, Warren
Sure,

1.  In PHP/Mysql extract rows and save them to a file in delimited fashion,
for numeric values be sure to align all the number digits (cobol is
dependent on numeric fields being aligned), you can do this with 

sprintf(%09.02f,$dbfloat);

Your delimiter character can be any character that is not a part of any of
your data, I tend to favor the vertical bar |.

2.  FTP the file to the system with COBOL (I am assuming mainframe but it
doesn't matter) using a character transfer type which will convert all ascii
characters to their EBCDIC equivalants.  Most mainframe systems support
tcp/ip (required for ftp), and if your shop uses products like NDM (network
data mover), look closely, ftp is actually doing the transfer between
unix/mainframe in the guise of NDM.  Your mainframe TSO id/password should
be all that is needed to do the transfer, and yes, it can occur while you
are signed on.

NOTE: assuming IBM Mainframe, if you do second FTP connection and use the
SITE JES command, and follow that with a GET filename where filename on
the mainframe contains execution JCL, the JOB will be submitted if your id
has sufficient access, and FTP is supposed to wait until the job is complete
and transfer the JES output back to your server file.  In my shop this
tranfer back part doesn't work (perhaps I'm not using the right SYSOUT
class, not sure), so I cause all the output from my job to go to a physical
file on the mainframe, but because the wait part works, I can then establish
another FTP connection (after the job has completed and without the SITE
command), and GET the file left behind by the job.

3.  In COBOL, read a variable length record from the transferred file and
UNSTRING the record contents into your element definitions, delimited by
your delimiter character above.  You may have to UNSTRING numeric values
into a PIC X(?) data element first, and then do a second UNSTRING to break
apart the digits to the left or to the right of the decimal.  Now you are
free to do what you need to with the data in COBOL.

Good luck,

Warren Vail
 


 -Original Message-
 From: Andre [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, November 20, 2004 6:56 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PhP e COBOL
 
 
 Hello 
 
 I need some help in this subject php + COBOL.
 I need to load data of a program in COBOL for a site written in php. 
 The data must be loaded for a DB in mysql. 
 Any one knows as I make this.
 Thank for the help
 
 André Caridade
 
 

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



RE: [PHP] HTML form online

2004-11-19 Thread Vail, Warren

 I want to write php script that fill out HTML form online. 
 Any ideas how to do it?

I'm probably reading too much into your question, but it sounds like there
is another website with a form on it, and you would like to develop a script
that would connect to the website, fill in the information on the form and
post the results to the other website as if an operator were doing this via
a browser.  Does that sound more like your question?

If so you probably want to start here;

http://www.php.net/manual/en/ref.curl.php

Hope this helps,

Warren Vail

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



RE: [PHP] PHP Supremacy...

2004-11-17 Thread Vail, Warren
Because among 17 million installed domains, and because the Open Source is
open, someone in those 17 million domains will keep it going.

http://www.php.net/usage.php

Some people never get it, you confuse them with too many facts, hope your
manager has an open mind.

Warren Vail


 -Original Message-
 From: Matthew Sims [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, November 17, 2004 2:55 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP Supremacy...
 
 
  Hello my friends, I need your help in convince to my boss 
 in adopt php 
  for development of a tool for intranet in my office, he 
 told me that 
  php is open source and we don´t know if will disappear in a 
 year, or 
  if php have a support like .net.
 
  what arguments can I show for convince him to try PHP?
 
  Thank you very much :)
 
 If the original developers of PHP decide to stop working on 
 PHP, anyone can pick it up and continue developing it since 
 it's open source.
 
 If Microsoft one day decides to stop work on .NET or goes out 
 of business, well then that's just too bad. It's proprietary, 
 belongs only to Microsoft and no one has access to the source 
 code to continue its work.
 
 Seeing the major breakthrough PHP has made in the past few 
 years, does your boss really think PHP is going away?
 
 I see that Perl is still around.
 
 -- 
 --Matthew Sims
 --http://killermookie.org
 
 -- 
 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] Multiple checkboxes and multiple textboxes

2004-11-05 Thread Vail, Warren
Hard code the array occurrence number in the checkbox and textbox names;

input type=checkbox name=url[1] value='http://somesite' 
checked a href='http://somesite' target=asomesite/a 
brinput type=text name=txt[1] size=75 value='some desc'

The form will only return the checkboxes that are checked and the textboxes
will return all textboxes (that is the nature of these input controls with
most browsers);

$urls = $_POST[url];
$temptexts = $_POST[txt];
Foreach($urls as $no = $val) {
   $txt[$no] = $temptxts[$no];
}

Now $txt contains only matching text fields.

Hope this helps,

Warren Vail


 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 05, 2004 11:28 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Multiple checkboxes and multiple textboxes
 
 
 Hi,
 I have a form that has something like this:
 
 input type=checkbox name=url[] value='http://somesite' 
 checked a href='http://somesite' target=asomesite/a 
 brinput type=text name=txt[] size=75 value='some desc'
 
 input type=checkbox name=url[] value='http://somesite1' 
 checked a href='http://somesite1' target=asomesite1/a 
 brinput type=text name=txt[] size=75 value='some desc1'
 
 input type=checkbox name=url[] value='http://somesite2' 
 checked a href='http://somesite2' target=asomesite2/a 
 brinput type=text name=txt[] size=75 value='some desc2'
 
 As you can see from the above, theses a checkbox (url[]) 
 which holds the value of the URL and a textbox (txt[]) which 
 holds some description text, in the above there are only 3 
 rows but actually there are 200 per page. When the form is 
 submitted how do I make sure that if url[] is unchecked even 
 txt[] should not be taken?
 
 These values will be entered into the database so I need 
 proper matching pairs of URL and TXT
 
 Thanks,
 Ryan
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP] Re: Passing values from a new window

2004-11-05 Thread Vail, Warren
I can recommend http://www.hotscripts.com (the javascript section).

Warren Vail


 -Original Message-
 From: Todd Cary [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 05, 2004 1:17 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Passing values from a new window
 
 
 Is there a place where I can view some examples of using JavaScript?
 
 Todd
 
 Todd Cary wrote:
 
  I have a button that creates a new window.  The surfer may 
 enter data 
  in
  the new window, and if he does, when the window is closed 
 by the surfer, 
  can the information update fields on the original page - 
 the page/window 
  from which the new window was created?
  
  I have seen instances where the surfer can open a new window to get
  email addresses and these addresses appear in the first window.
  
  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] Re: Passing values from a new window

2004-11-05 Thread Vail, Warren
That foot sticking out of his monitor was his choice

Warren Vail


 -Original Message-
 From: Matthew Sims [mailto:[EMAIL PROTECTED] 
 Sent: Friday, November 05, 2004 2:08 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Passing values from a new window
 
 
  [snip]
  Is there a place where I can view some examples of using 
 JavaScript? 
  [/snip]
 
  A. Type http://www.google.com in your browser's address bar 
 or click 
  on the handy link provided. If push comes to shove, cut and 
 paste the 
  address into your browser's address bar. 2. Carefully and 
 thoughtfully 
  type JavaScript examples in the text box that appears. If 
 push comes 
  to shove, cut and paste the text into the text box that appears.
  III. Click on the button that reads Google Search
 
  Thousands of examples will be yours to behold.
 
  :7)
 
 
 
 Can you pick one for me?
 
 ;)
 
 -- 
 --Matthew Sims
 --http://killermookie.org
 
 -- 
 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] Zip Codes

2004-11-04 Thread Vail, Warren
Do you mean other than asking them, like using their IP address?

Warren Vail

-Original Message-
From: bb9876 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Zip Codes


Is there any way to use PHP to determine the zip code someone is visiting
from, assuming they are all from the US?

-- 
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] Zip Codes

2004-11-04 Thread Vail, Warren
One thing I might be tempted to try would be to execute a trace route
utility and analyze the output, but it is very cryptic;

http://www.traceroute.org/
http://www.tracert.com/cgi-bin/trace.pl

HOSTLOSS  RCVD SENTBEST AVG
WORST
er1.sfo1.speakeasy.net0%20   20   25.70   30.68
89.13
220.ge-0-1-0.cr2.sfo1.speakeasy.net   0%20   20   24.02   26.56
58.23
ge-4-0-440.ipcolo1.SanJose1.Level3.net0%20   20   24.38   25.28
27.09
ae-1-56.bbr2.SanJose1.Level3.net  0%20   20   24.26   31.00
97.58
so-3-0-0.mp1.SanFrancisco1.Level3.net 0%20   20   25.49   28.89
49.58
so-10-0.ipcolo1.SanFranciso1.Level3.net   0%20   20   25.17   25.81
26.73
gw-level3-sfo.internap.com0%20   20   27.32   28.12
29.58
border4.ge3-0-bbnet2.sfo.pnap.net 0%20   20   27.11   28.24
28.93
??? 100% 0   200.000.00
0.00

If you can figure out how to make sense of this, you might be able to find
the point that a system is connected to the internet, by tracing back to a
visitors current IP address.

If you come up with something useful, keep the list informed.

Warren Vail


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:22 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Codes


bb9876 wrote:
 Is there any way to use PHP to determine the zip code someone is 
 visiting from, assuming they are all from the US?
 

Outside of asking the visitor for it, no.

-- 
John C. Nichel
ÜberGeek
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] Zip Codes

2004-11-04 Thread Vail, Warren
Because for some of us, that part of our body is the smartest thing we have
going, and the rest of us is not engaged in the question.

Warren Vail

-Original Message-
From: bb9876 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:41 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Codes


Thanks for the sarcasm, it definitely helps.

Why is it that when people ask a question there is always someone that has a
smartass answer?

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Thursday 04 November 2004 16:59, bb9876 wrote:
  Is there any way to use PHP to determine the zip code someone is
visiting
  from, assuming they are all from the US?

 Something like this should work:

 -- start
 form action=?php echo $_SERVER['PHP_SELF'];  ? method=POST 
 Please input zipcode input type=text name=zipcode value= 
 input type=submit name=submit value=Enter /form

 ?php
   if (!empty($_POST['zipcode'])) {
 echo Whoa! your zipcode is {$_POST['zipcode']};
   }
 ?
 -- end

 --
 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
 --
 /*
 Thinking you know something is a sure way to blind yourself.
   -- Frank Herbert, Chapterhouse: Dune
 */

-- 
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] Strange query

2004-11-04 Thread Vail, Warren
The second limit parameter is the actual number of rows to limit to, and in
most situations this is usually the same number (i.e. 0,15; 15,15; 30,15;
etc).  It is too bad this clause is not supported by some of the other
databases I have had to use, it makes a convenient way of paging where the
second paging parameter specifies the page size in terms of rows to retrieve
(first parameter is the starting row number starting with zero).

Warren Vail


-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 11:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Strange query


Hi,
I am running this query from my script:

  $query = select gallery_url,description from members limit
.$limit[0].,.$limit[1];

the first time: limit 0,15
and the second time: limit 16,30


the problem is the first time I am getting 15 rows returned (as expected)
the second query of select gallery_url,description from members limit 16,30
is returning 17 rows!!

I've even tried it within phpmyadmin and its giving me 17 rowswhat am I
missing here?

Thanks,
Ryan

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

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



RE: [PHP] Question: Validation on a text field

2004-11-04 Thread Vail, Warren
Assuming that the pasting is done into a textarea/textarea on an html
form, I believe the Textarea will limit the past to just text characters.


I suppose this could be dependent on the browser.  

I don't know of any html input control that would allow blob (binary)
values.

I also don't know if MySQL will police things input to a text column to make
sure they are valid ascii text characters.

Warren Vail


-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 12:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Question: Validation on a text field


I have a field that is an actual Mysql Text column,
aka like a blob.  I'm wondering if doing a standard
validation that checks for characters outside of the alphanumeric range is
enough.  I'm imagining some users will cut and paste from a Word or PDF doc
into the field. I've done it myself and no weird characters are showing up.

Any thoughts ?

Stuart

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

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



RE: [PHP] getting a number range from user input.. (weight)

2004-11-04 Thread Vail, Warren
Not sure I completely understand what you are trying to do.  In your
problem, seems to me that both 1.3 and 1.6 would fall under 2.0 and neither
of them would fall under 1.0.  You must be using some logic that I am not
getting.  Can you be a little more specific?

Warren Vail


-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 7:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] getting a number range from user input.. (weight)


How can i match a range of numbers from a given input?
i tried round() but it rounds off the numbers to the next number, so that
will be wrong.

My example below show 4 examples of what my db tables looks like.

weight   value
.59.45
1.0 10.71
1.5 11.97
2.0 13.23

How can i get the range of:

.1 to fall under .5 and
1.3 to fall under 1.0 and
1.6 to fall under 2.0

and so on.. any ideas?

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

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

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



RE: [PHP] getting a number range from user input.. (weight)

2004-11-04 Thread Vail, Warren
Are you trying to round to the nearest .5 value?

Warren Vail


-Original Message-
From: Vail, Warren 
Sent: Thursday, November 04, 2004 7:24 PM
To: 'Louie Miranda'; [EMAIL PROTECTED]
Subject: RE: [PHP] getting a number range from user input.. (weight)


Not sure I completely understand what you are trying to do.  In your
problem, seems to me that both 1.3 and 1.6 would fall under 2.0 and neither
of them would fall under 1.0.  You must be using some logic that I am not
getting.  Can you be a little more specific?

Warren Vail


-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 7:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] getting a number range from user input.. (weight)


How can i match a range of numbers from a given input?
i tried round() but it rounds off the numbers to the next number, so that
will be wrong.

My example below show 4 examples of what my db tables looks like.

weight   value
.59.45
1.0 10.71
1.5 11.97
2.0 13.23

How can i get the range of:

.1 to fall under .5 and
1.3 to fall under 1.0 and
1.6 to fall under 2.0

and so on.. any ideas?

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

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

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

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



RE: [PHP] Passing a list in the Header

2004-11-02 Thread Vail, Warren
Not sure why you need to pass it in the header as apposed to the body, since
html provides the following;

- snip
form action=postpgm.php method=post
input type=hidden name=arrayvalue[0] value=value0
input type=hidden name=arrayvalue[1] value=value1
input type=hidden name=arrayvalue[2] value=value2
- snip

And in the form postpgm.php

$receivedarray = $_POST[arrayvalue];

// $receivearray will be an array type with all the values above.

If I were doing this, I would have chosen PHP sessions to pass this
information since then it can't be modified by the user, and the array
content doesn't need to make the round trip to the browser and back (I have
to pay for my bandwidth).

http://www.php.net/manual/en/ref.session.php

Only arrays I've seen in the header are JavaScript Arrays, and you'd have to
do something special in JavaScript to get them back.

Hope this helps,

Warren Vail

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 02, 2004 1:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Passing a list in the Header


I need to pass a list (preferably an Array) in the header.  Can this be 
done, and if so, what is the best method?

Also, how do I extract the info on the page that receives the info?

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] Passing marked rows in a table

2004-11-02 Thread Vail, Warren
Assuming you have an artificial key for your table (like an auto increment
column), I would place the key field to the table on your form in the value
of the checkbox;

input type=checkbox name=recsel[] value=$rowid

When the form is returned to your post php script it will only receive
those checkboxes that are checked and they will come loaded in an array
(because of the way the name is described, containing the [] characters);

$selarray = $_POST[recsel];

If(is_array($selarray)) $query = select * from datatable where tblkey in
(.implode(, ,$selarray).) ;
Else echo nothing selected;  // even an array containing one occurrence is
sufficient.

I believe all this is correct.  Good luck,

Warren Vail


-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 02, 2004 1:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Passing marked rows in a table


I create a list of records from a DB and each has a check box.  What is 
the best way to select those that were checked after the form is submitted?

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] Authentification related to browser window

2004-11-02 Thread Vail, Warren
I'm not sure which session parameter controls it, but my sites are setup so
that opening a new browser window will start a new session, and if your
pages require something in the session saying the user is logged on, he will
be forced to logon in the new session, since the variable will not be there.
I believe the parameter is the same one that tells it to terminate a session
when closing the browser.

To make this work, EVERY single page looks for this special session
variable, and if not found in the session array it redirects the visitor to
the signon page.  This means that if his session times out, he will also be
sent to the signon page, next time he tries to change pages.  With two
separate session id's, one for each browser instance, the two browsers
operate pretty much independently, each using their own session data.

Warren Vail


-Original Message-
From: Cristi Barladeanu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 02, 2004 2:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Authentification related to browser window


Greetings

My problem is pretty simple. User enters the site, logins, and after that he
hits ctrl+n or something, to open a new window from same browser. Can I make
him to login again in the new window but to keep him logged in the old one?

Now i'm using sessions, but i realise that the cookies set by them are
related to browser, so every window use them.

I hope you will understand what i mean.

Cheers, 
Cristi

-- 
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] No luck creating dynamic images

2004-11-01 Thread Vail, Warren
One trick I use is invoke the dynamic image module directly (code the URL in
the address field of the browser), along with making sure that the
outputting of headers doesn't take place until just before the image output
command.  This allows the browser to display any syntax errors and such.

Warren Vail


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 6:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] No luck creating dynamic images


On Monday 01 November 2004 18:24, Ken Tozier wrote:
 I've been trying for most of the day to generate a simple dynamic 
 image in my php script without any success. It seems obvious that 
 something isn't right with my php environment as even the simplest 
 images (like a
 rectangle) only yield the broken link icon. Does anyone know of any in
 depth resource for php trouble shooting? I've already scoured the
 php.net site and it wasn't of much help.

Enable FULL error reporting.

-- 
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
--
/*
 Hey, sexy mama. Wanna kill all the humans? -Bender 
*/

-- 
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] No luck creating dynamic images

2004-11-01 Thread Vail, Warren
?php
$im = imagecreate(100, 50)
    or die(Cannot Initialize new GD image stream);
$back_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  A Simple Text String, $text_color);
header(Content-type: image/png);   //-
move header to here
imagepng($im);
imagedestroy($im);
?

And invoke the module directly from your browser,

At http://localhost/dynamic_tabs.php

And now php should be able to help you find your problem.

Good luck,

Warren Vail


-Original Message-
From: Ken Tozier [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] No luck creating dynamic images



snip

 Enable FULL error reporting.

I tried this with error_reporting(E_ALL); and ran the script in 
multiple browsers no errors reported.

Also ran phpinfo(); (as suggested by Jay Blanchard) which worked 
without problem. The settings under GD were all enabled for the common 
image types.

Anybody see any glaring errors in the following?

Here's the html:

!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html
body bgcolor=#ff
img src=dynamic_tabs.php
/body
/html


And here's the php:

?php
header(Content-type: image/png);
$im = imagecreate(100, 50)
    or die(Cannot Initialize new GD image stream);
$back_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  A Simple Text String, $text_color);
imagepng($im);
imagedestroy($im);
?

-- 
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: GUI editor for php?

2004-11-01 Thread Vail, Warren
I like htmlkit; (it's free)

http://www.chami.com/html-kit/

Warren Vail


-Original Message-
From: Eric Bolikowski [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 2:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: GUI editor for php?




Andy B [EMAIL PROTECTED] skrev i melding
news:[EMAIL PROTECTED]
 Hi.

 Is there any GUI editors out there for php? if so does anybody know of 
 a good one that doesnt cost a ton of money??

There's a trial for Zend Studio at www.zend.com

Eric

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

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



RE: [PHP] problem with include()

2004-11-01 Thread Vail, Warren
How did you go to the page that included the login page, if you included it
in the tiny_edit.php (which is the routine that sets the cookie in the
browser, you need to cause the browser to send it back to you by doing a
redirect;

Header(Location: tiny_edit.php);
Exit;

When tiny_edit is entered the second time it should be able to retrieve the
cookie. (this is basically what you are doing manually by refreshing the
browser).

HTH,

Warren Vail

-Original Message-
From: Jason Davis [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 2:34 PM
To: PHP General List
Subject: [PHP] problem with include()


Hello,
 I have a login page .. the user types in user and pass  then the form
gets posted to tiny_edit.php 

tiny_edit.php checks user and pass then sets a cookie if auth is successful.
Then the original login page is included. The login page has logic at the
top to check for the auth cookie ... if there, it sends user to home page
.. if not it displays the login screen. This works mostly except ... when
the user auths ... the cookie gets set ... then the login page is included
.. the login page does not see the auth cookie until the user refreshes
their browser ... why is this happening?

thanks,
jd


login page 

?php
$bt = new AuthTool();
if($username = $bt-checkAuth()){
//send to homepage
print you are already logged on $username;
}
?

html
head
title
Tiny Edit Login
/title
link rel=stylesheet type=text/css href=inc/tiny_edit.css / /head
body form action=?php  echo $_SERVER['PHP_SELF']; ? method=post
table width=240 cellspacing=0 border=0
tr
td width=100% class=white align=center
bTiny Edit Login/b
/td
/tr
/table
table width=240 cellspacing=0 border=0
tr
td class=grey width=120 align=centerUser:/tdtd
class=grey width=100input type=text name=user/td
/tr
tr
td class=grey width=120 align=centerPass:/tdtd
class=grey width=100input type=password name=pass/td
/tr
/table
table width=240 cellspacing=0 border=0
tr
td width=100% class=white align=right
input type=submit value=Login
class=submitstyle
/td
/tr
/table
form
/body
/html



tiny_edit.php
if(!$_GET['instance']  !$_POST['instance']){
$at = new AuthTool();
if($_POST['user']  $_POST['pass']){
$at-auth($_POST['user'],$_POST['pass']); //this sets cookie
if user and pass are correct
}
include inc/tiny_edit_login.inc.php; 
}



thanks,
jd

-- 
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] Session and validation

2004-10-29 Thread Vail, Warren
You might consider another approach, if you are using php5.  It's called
PRADO, I believe it was overall winner of the PHP programming contest
sponsored by ZEND.

http://www.zend.com/php5/contest/contest.php?id=36single=1

This is how the product is described;

 snip---
PRADO is an event-driven and component-based framework for Web application
development in PHP5. 

Developing a Web application with PRADO mainly involves instantiating
prebuilt and application-specific component types, configuring them by
setting their properties, and composing them into application tasks. Some
repetitive and tedious work, such as form field validation and page state
management, can be accomplished easily in this fashion with the provided
PRADO components. Using PRADO to develop Web application will bring you
familarity of developing desktop GUI application with RAD tools such as
Borland Delphi, Visual Basic, etc. You will also find it is like ASP.NET in
many aspects. 
- snip---

I haven't tried this myself, but it looks like it may be geared to what you
are seeking.  Much of the rave seems to be it's event driven nature (unusual
for web apps).  I hope to be using it myself in the next few months.  If the
reviews are any clue, I would expect it to become part of a future release
of PHP.  Time will tell.

Warren Vail


-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 29, 2004 4:23 PM
To: Stuart Felenstein; [EMAIL PROTECTED]
Subject: RE: [PHP] Session and validation


[snip]
I had this thread going yesterday.  Then basically
think it reached a stalemate.  I'm wondering has
anyone setup forms using session variables and
validation.  Validation where the validating is done
on the same page, and the redirected on success ?
[/snip]

You need a class which will generate and validate your forms dynamically.
Pear provides two packages (the second an extension of the
first):

http://pear.php.net/package/HTML_QuickForm
http://pear.php.net/package/HTML_QuickForm_Controller

I've never used these as I wrote my own library to handle this a few years
ago, but from what I understand these two packages will do the trick.

Basically it will work thusly:

1)  On a page where you need a form, you declare a new form object, specify
all your inputs, how they should be validated, etc., and these are then
stored in the session.

2)  On the receiving page you call the form validation object, passing in an
identifier for which form should be validated.

3)  If it validates your script will continue unfettered, else it will
update the values in the session with the appropriate error message and
redirect you back to the original form, which, since you are using session
variables to display the inputs, will now be updated with the error
messages.

HTH,
Pablo

-- 
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] Review: Function that measures the width of a text stri ng in pixels.

2004-10-28 Thread Vail, Warren
There is a function in the GD library that measures text size;

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

But it has an advantage you don't have, once it has places exactly the font
it wants, the size it wants, directly into an image, it knows that the
browser won't change the image.  With the font inside an image, the browser
won't substitute another font, or use a different size because the one you
have specified in your font statement is not available on the users machine.
Perhaps there is a way for JavaScript to send you a list of available fonts
on the end users machine?  Course the end user could have fonts you never
heard of.  I think this is one of those things (like hand grenades and horse
shoes) where being close counts. ;-)

Warren Vail


-Original Message-
From: Robby Russell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 28, 2004 3:27 PM
To: Jacob Friis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Review: Function that measures the width of a text string
in pixels.


On Fri, 2004-10-29 at 00:11 +0200, Jacob Friis wrote:
 I have created a function that will measure the width of a text string
 in pixels. It works ok.
 If you have optimizations, please let me know.
 Thanks,
 Jacob
 
 function txt_width ($txt) {
   $width = 0;
   $txt_len = strlen($txt);
   for ($n = 1; $n = $txt_len; $n++) {
   switch (substr($txt, $n, 1)) {
   case 'l';
   case '.';
   case ' ';
   case '-';
   case 't';
   $width += 3;
   break;
   default :
   $width += 8;
   break;
   }
   }
   return $width;
 }
 

.and how do you plan to account for things such as, font sizes on all
platforms, font types, etc?


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting  Development
*--- Now supporting PHP5 ---
/

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



RE: [PHP] https://...

2004-10-27 Thread Vail, Warren
Depends on the server and the release, but my apache shows

If($_SERVER[HTTPS] == on) // if true is secure

Lots of other information like cypher key size, etc.

Look in the $_SERVER array.

Keep in mind that lots of servers are setup to use the same htdocs base
directory for both secure and insecure pages, what happens if someone comes
to your unsecured page using https?  Another example is, if you have coded
full urls for images, the browser will usually complain if the page is
accessed via https and the image via http.

Warren Vail


-Original Message-
From: Greg Donald [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 3:01 PM
To: php-general
Subject: Re: [PHP] https://...


On Wed, 27 Oct 2004 16:35:14 -0500, Afan Pasalic [EMAIL PROTECTED] wrote:
 hi,
 how can I check using php that I use SSL?
 tried with
 REQUEST_URI
 HTTP_HOST
 PATH_INFO
 but any of these does show http://

phpinfo() describes my SSL stuff pretty well if that's what you mean.

And I also found:
http://marc.theaimsgroup.com/?l=php-generalm=109767486431095w=2


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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

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



RE: [PHP] User Screen Resolution

2004-10-27 Thread Vail, Warren
This is because there is no way for PHP to run in the browser.  Wouldn't it
be nice to have a plug-in that allowed PHP to run there, perhaps as a
JavaScript replacement?  Guess it would have to be a throttled back version
of PHP to adhere to sandbox security concerns.  Sigh

Warren Vail


-Original Message-
From: Larry E. Ullman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 3:40 PM
To: Web Guy
Cc: PHP
Subject: Re: [PHP] User Screen Resolution


 I am new to PHP and couldn't find any Globals for the User's Screen 
 Resolution. (don't laugh at me please)

 I used to use a Javascript function to pass the resolution using 
 screen.width and screen.height.

 What I am actually trying to do is make a page resize depending on
 screen
 resolution, in case that helps anyone.

Using PHP you can neither find the screen resolution nor resize the 
browser window. Both must be accomplished using JavaScript.

Larry

-- 
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: RE: [PHP] User Screen Resolution

2004-10-27 Thread Vail, Warren
One aspect of this list that I really enjoy is finding out that everyone but
me is on vacation or out of the office. 

8-b

Warren Vail


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 4:22 PM
To: Vail, Warren
Subject: Re: RE: [PHP] User Screen Resolution


Phil Ewington will be out of the office until 1st November.

If your enquiry is urgent please email Ian Lowe ([EMAIL PROTECTED]).

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



RE: [PHP] User Screen Resolution

2004-10-27 Thread Vail, Warren
Good point, I suspect much of the desirability of having PHP on the client,
is it seems almost cruel and unusual punishment to have to learn how to use
a screwdriver, after having spent valuable time learning all about a hammer.
I wonder if I would have been so enthusiastic about learning and using PHP
if I had known in the beginning that I'd need to learn JavaScript as well.

Warren Vail

-Original Message-
From: Brad Bonkoski [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 4:33 PM
To: Vail, Warren; 'Larry E. Ullman'; Web Guy
Cc: PHP
Subject: Re: [PHP] User Screen Resolution


There has been talk in the past about making a phpscript that would run on 
the client, but then there are all the problems with browser integration, 
and universal support.  I say this is a good niche for javascript, so make 
use of it if you need it just like you don't use a hammer to tighten a 
screw...

- Original Message - 
From: Vail, Warren [EMAIL PROTECTED]
To: 'Larry E. Ullman' [EMAIL PROTECTED]; Web Guy 
[EMAIL PROTECTED]
Cc: PHP [EMAIL PROTECTED]
Sent: Wednesday, October 27, 2004 7:05 PM
Subject: RE: [PHP] User Screen Resolution


 This is because there is no way for PHP to run in the browser.  
 Wouldn't
 it
 be nice to have a plug-in that allowed PHP to run there, perhaps as a
 JavaScript replacement?  Guess it would have to be a throttled back 
 version
 of PHP to adhere to sandbox security concerns.  Sigh

 Warren Vail


 -Original Message-
 From: Larry E. Ullman [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, October 27, 2004 3:40 PM
 To: Web Guy
 Cc: PHP
 Subject: Re: [PHP] User Screen Resolution


 I am new to PHP and couldn't find any Globals for the User's Screen 
 Resolution. (don't laugh at me please)

 I used to use a Javascript function to pass the resolution using 
 screen.width and screen.height.

 What I am actually trying to do is make a page resize depending on 
 screen resolution, in case that helps anyone.

 Using PHP you can neither find the screen resolution nor resize the 
 browser window. Both must be accomplished using JavaScript.

 Larry

 --
 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] Default value if parameter is not passed in

2004-10-27 Thread Vail, Warren
I notice that none of your variables use the PHP convention of $ preceding
the variable name, I also do not see you defining a value for DEFAULT_VALUE,
which by the upper case convention seems to be referring to a global
constant.  Is it not true (no pun intended) that if a variable (or constant)
has not been defined, that assigning the contents of that variable (or value
of the constant) will return a false (i.e. a 1)?

Not sure I remember it all correctly but it seems to ring an ancient bell
for me.

HTH,

Warren Vail

-Original Message-
From: Quanah Gibson-Mount [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 4:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Default value if parameter is not passed in


Right now, I'm tweaking a function that has a bunch of optional parameters. 
I would like to be able to set a default value for the very last one if it 
is not passed in.  This essentially looks like:


if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|ssl, link, arg1, 
arg1_len, arg2, arg2_len, long, long_len) == FAILURE { RETURN_FALSE; }

if (!long || long==NULL) {
 long=DEFAULT_VALUE;
}

However, what I found when printing out the value of long is that it has 
been set to 1?!  I imagine this was by the zend_parse_parameters function. 
Is there a way to disable it from setting values to optional parameters?

--Quanah

--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

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

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



RE: [PHP] Default value if parameter is not passed in

2004-10-27 Thread Vail, Warren
OK, so it was C code on a PHP list, isn't there a PHP developers list that
would work better?

Warren Vail

-Original Message-
From: Quanah Gibson-Mount [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 4:56 PM
To: Vail, Warren; [EMAIL PROTECTED]
Subject: RE: [PHP] Default value if parameter is not passed in




--On Wednesday, October 27, 2004 4:53 PM -0700 Vail, Warren 
[EMAIL PROTECTED] wrote:

 I notice that none of your variables use the PHP convention of $ 
 preceding the variable name, I also do not see you defining a value 
 for DEFAULT_VALUE, which by the upper case convention seems to be 
 referring to a global constant.  Is it not true (no pun intended) that 
 if a variable (or constant) has not been defined, that assigning the 
 contents of that variable (or value of the constant) will return a 
 false (i.e. a 1)?

This is inside the C source code for PHP.  C does not prefix variables with 
a $.

The DEFAULT_VALUE was simply shorthand for what I'm setting it to, and is 
not representative of an actual value, and that bit doesn't particularly 
matter, since it was never getting executed (although it was for a global 
constant from a header file).

--Quanah

--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

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



RE: [PHP] PHP Compiler?

2004-10-27 Thread Vail, Warren
Try;

http://www.zend.com

Warren Vail


-Original Message-
From: Bill McCuistion [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 5:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Compiler?


Sorry if this is an old question:  

Where can I find information on any plans to create a compiler for PHP,
especially v5.x?

Barring that, is there a PHP syntax checker that would enforce some of the
types of things that a compiler would find?  

I remember from back in my MS-DOS days the very good Clipper compiler for
the dBase III language.  dBase III, not unlike PHP, was an interpretive
language, and along the way some bright folks figured out how to write a
true dBase language compiler, which then allowed for all sorts of nice
things to happen.  One of the nicest things for me was that the compiler
caught all sorts of little things before the same code in the interpreter
would find them at run-time.

-- 
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] Pure PHP menu tree

2004-10-25 Thread Vail, Warren
Do you really want to have every single click go back to the server and then
have the browser need to reload your entire page just to expand a limb (not
sure limb is the right term) of the tree?  That is what you would have to do
to be pure PHP solution since the only place PHP can execute is on the
server.  JavaScript is generally accepted as the solution that will produce
the fastest user interface response, because it runs in the browser machine,
and does not require the trip to the server and back just to expand a part
of the tree.  There are a couple of really good js solutions available,
blueshoes has a good one.

http://www.blueshoes.org/en/javascript/tree/

If you are willing to distribute PHP to each workstation along with your
code, you could consider creating a PHP GUI (Windows type) application that
does not execute through a browser.  PHP-GTK provides a tree widget, but
if you are not used to developing for a windows (non-web) type environment
it could prove quite tough.

http://gtk.php.net

Hope this helps,

Warren Vail


-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 25, 2004 3:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Pure PHP menu tree


Hi,
I have been searching on the net for the past 2 hours without success, so
need a recommendation now :-)

Basically i am looking for a PHP menu tree, looking on google I have found
many but most of them use Javascript with php, or are pure JS or DHTML, I
want one that is pure php so it will work accross all browsers.

Nothing overly complicated, something such as this would be perfect:

[+]expand1
[-]expanded2
[something 1]
[something 2]
[something 3]
[+]expand 3

Other requirements:
-It should work in frames
-you can expand more than one at a time

eg:
[+]expand1
[-]expanded2
[something 1]
[something 2]
[-]expand 3
[something x]
[something y]
[+]expand 4

I have seen something like this somewhere, problem is, I dont really
remember where. The idea is not new and I have also been exploring the php
classes site to check over there as i'm quite sure something like this HAS
been done...(I dont want to sit and recreate the whole thing as I am already
in the middle of another project) if anybody can point me in the right
direction as to where i can get thismucho gracias :-)

Cheers,
Ryan

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

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



RE: [PHP] fopen by URL is disabled, is there another way of readi ng a remote webpage?

2004-10-20 Thread Vail, Warren
CURL?

http://www.php.net/manual/en/ref.curl.php

Warren Vail
 


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 20, 2004 10:25 AM
To: Chuck Barnett
Cc: PHP General List
Subject: Re: [PHP] fopen by URL is disabled, is there another way of reading
a remote webpage?


-- Original message from Chuck Barnett : -- 

 Hi, my new server has fopen by url disabled. My ISP doesn't want to 
 turn it
 on. So is there a way to do an equivilant function some other way? I need 
 to read a remote webpage and manipulate it. 
 
 Thanks,
 Chuck 

You could use sockets. Here's an example from the archives
http://marc.theaimsgroup.com/?l=php-generalm=105052005332001w=2

The example is sending a POST, but you can easily change it to a GET.

-- 
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] people/projects looking for developers...

2004-10-18 Thread Vail, Warren
Check out the following, probably a lot more;

http://www.guru.com/  (used to be itmoonlighter.com)
http://www.sologig.com/ (site written in php)
http://www.prosavvy.com/ 
http://rfq.programmingbids.com/

I have even seen a few on this list, although it is considered a little off
topic, I have yet to see anyone banned from the list for describing a work
requirement (not that I would).  Everyone knows people on this list have
entirely too much time on their hands (and not enough money) ;-).

Now if you are after people who will work for free  Get those kind of
offers every day, including from my current employer from time to time, if
you know what I mean.

Good luck,

Warren Vail


-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 18, 2004 6:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] people/projects looking for developers...


hi...

a question for consideration. are there sites set up for people who have
ideas/projects, who are looking for developers. or vice versa, are there
sites for developers who are looking to be part of projects.

i'm not referring to open source projects, rather projects that are intended
to be revenue generating businesses.

thanks

Bruce Douglas
[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] Exporting HTML to Excel

2004-10-13 Thread Vail, Warren
 header('Content-Type: application/ms-excel');
 header('Content-Disposition: attachment; filename=project.htm'); ?
AAA used by
excel to determine translation, I believe

I believe the Content-Type is referred to as a mime header (8-}), I often
see something similar in email.

HTH,

Warren Vail
(415) 667-0240
SF211-07-434
 


-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 13, 2004 6:18 AM
To: Vail, Warren
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Exporting HTML to Excel


How exactly would I change the mime headers?

~Philip

On Oct 12, 2004, at 5:07 PM, Vail, Warren wrote:

 Have you tried changing your file name to project.htm but continue
 issuing
 the mime headers for excel?

 Warren Vail

 -Original Message-
 From: Philip Thompson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, October 12, 2004 2:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Exporting HTML to Excel


 Hi all.

 This may not be completely a PHP question, but hopefully you will be 
 able to provide some insight. I have a table in HTML that I want to 
 export to an excel spreadsheet. Using PHP, I can create an excel 
 document - however, it's empty/blank. I think I am just doing it 
 incorrectly. Anybody done this before and/or have any ideas? I would 
 prefer to NOT use a third-party program.

 I've searched the web and php.net, but have been somewhat unsuccessful 
 in finding anything. Here's what I have so far:

 -
 ?php
 header('Content-Type: application/ms-excel');
 header('Content-Disposition: attachment; filename=project.xls'); ?

 table
   tr
   tdSomething/td
   /tdSomething else/td
   /tr
 /table
 -

 I just want it to have that content in the spreadsheet. It's actually 
 more involved than that, but that's the gist of it.

 Thanks in advance.
 ~Philip

 --
 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] Exporting HTML to Excel

2004-10-12 Thread Vail, Warren
Have you tried changing your file name to project.htm but continue issuing
the mime headers for excel?

Warren Vail

-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 12, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Exporting HTML to Excel


Hi all.

This may not be completely a PHP question, but hopefully you will be 
able to provide some insight. I have a table in HTML that I want to 
export to an excel spreadsheet. Using PHP, I can create an excel 
document - however, it's empty/blank. I think I am just doing it 
incorrectly. Anybody done this before and/or have any ideas? I would 
prefer to NOT use a third-party program.

I've searched the web and php.net, but have been somewhat unsuccessful 
in finding anything. Here's what I have so far:

-
?php
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename=project.xls'); ?

table
tr
tdSomething/td
/tdSomething else/td
/tr
/table
-

I just want it to have that content in the spreadsheet. It's actually 
more involved than that, but that's the gist of it.

Thanks in advance.
~Philip

-- 
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] Is there any way of knowing User Currently Logged On?

2004-10-11 Thread Vail, Warren
If you code in php something like the following, you just might be able to
use the perl script;

$ok = exec(path/to/Perl myperscriptname.pl server, $result);   // you may
have to straighten out syntax
Foreach($result as $line) {
echo $line;   // or you could process the results
}

Hope this helps,

Warren Vail


-Original Message-
From: Mulley, Nikhil [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 11, 2004 9:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Is there any way of knowing User Currently Logged On?


Hi Guys,
 
Is there any way of finding the current user logged on the remote system
 
I have a perl script which gets the user name who is currently logged on a
remote Windows Machine
 
 
 
 
 
#LoggedOnUsers(server, userRef).pl
use Win32::NetAdmin;
use strict;
use vars qw($server @users_list);
if(@ARGV0){
$server=$ARGV[0];
}
else{
print \n\nEnter a valid Hostname  or IP Address : ;
chomp($server=STDIN); }
Win32::NetAdmin::LoggedOnUsers($server,[EMAIL PROTECTED]);
foreach(@users_list) {
print \n$server-- $_;
}
 
 
This one gets the users logged in on a remote Windows machine , Is there a
similar way of finding / doing the same regardless of an OS, Can it be done
through a Web Browser 
 
Any Clues ??
 
--Nikhil.

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



RE: [PHP] general research question (maybe a little OT, sorry)

2004-10-07 Thread Vail, Warren
Once heard someone say the same about wiki sites. 8-)

Warren Vail


-Original Message-
From: lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 07, 2004 11:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] general research question (maybe a little OT, sorry)


Hi List,

My boss recently called PHP good for hobbyists but REAL sites have to 
be done with Microsoft technologies.  He wants to use Sharepoint for a 
wiki type site because of versioning.

Can anyone point me to resources about versioning and inherent 
strengths and reliability of PHP?

Thanks.
-dg

-- 
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] Determining the length (in an audio sense) of an MP3

2004-10-07 Thread Vail, Warren
Haven't looked specifically at mp3 but with most sound formats the sample
rate divided into the number of characters in the file should produce the
time length (i.e. 22000 samples per second divided into a 44 byte data
length results in 20 seconds of sound).  Seems to me that with most formats
(wav, etc) the sample rate is recorded with the data so that the player can
play back at the correct rate.  Not familiar with oog but did find some
references to ogg (google is your friend here).

http://www.borg.com/~jglatt/tech/wave.htm

Google produced the following on mp3

http://mpgedit.org/mpgedit/mpeg_format/MP3Format.html
http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm

Hope this helps,

Warren Vail


-Original Message-
From: Paul Reinheimer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 07, 2004 4:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Determining the length (in an audio sense) of an MP3


Hi,

I am trying to determine the length (in terms of seconds) of an MP3 file. I
have seen the ID3 pear project, but I didn't see anything there to tell me
how long the song was. There is a fileinfo pecl project, but it doesn't
mention MP3s and I couldn't find any good documentation for it (looking at
the pecl site).

Does anyone know of an decent way to determine the length of a song? What
about other formats (oog, wav, etc?).


thanks
paul

-- 
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] why this doesn't work as an external file but does inte rnally?

2004-10-06 Thread Vail, Warren
Perhaps you fixed things but they all appeared to work for me (at least
mostly).

https://celestica.tristarpromotions.com/NEW/index3.php

This last one, seemed to not do the mouseout on the contact button, but
all three seemed to work.

Good job,

Warren Vail


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 05, 2004 8:20 PM
To: 'PHP Mailing Lists'
Subject: Re: [PHP] why this doesn't work as an external file but does
internally?


Aaron Wolski wrote:
 Ok.. here are 3 links:
 
 https://celestica.tristarpromotions.com/NEW/index2.php
 
 This link... you'll see that the rollover effects on the top menu 
 work. The external JS file (called: jsstuffnew.php) has code that 
 looks like:
 
 img1on = new Image();   img1on.src = ?php echo $base_url;
 ?Graphics/home_on.gif;
 
 https://celestica.tristarpromotions.com/NEW/index.php
 
 This link... you'll see that the rollover effects on the top menu DO 
 NOT work. The external JS file (called: jsstuff.php) has code that 
 looks
 like:
 
 img1on = new Image();   img1on.src = ?php echo $base_url;
 ?Graphics/?php echo $img_home_on; ?;
 
 As you can see, the difference between the two is the fact that the 
 image FILE NAME is hard coded into the file as opposed to calling.
 
 
 https://celestica.tristarpromotions.com/NEW/index3.php
 
 This link... you'll see that the rollover effects work as well. 
 Instead of having an external file I have embedded the JS code 
 directly into the page.
 
 Additionally, I have use code that looks like:
 
 img1on = new Image();   img1on.src = ?php echo $base_url;
 ?Graphics/?php echo $img_home_on; ?;
 
 
 Having visuals... does that help communicate what the problem is?

Yes, the output of your JavaScript in the second example is missing 
$img_home_on (it's outputting nothing).  Where does this variable get 
set?  How about posting the php code for 
https://celestica.tristarpromotions.com/NEW/jsstuff.php


-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com

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

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



RE: [PHP] why this doesn't work as an external file but does inte rnally?

2004-10-05 Thread Vail, Warren
Right on, a .js file is probably not processed by the PHP engine, but while
it's imbedded in a .php file, it is.  Apples and Oranges, no?

Warren Vail


-Original Message-
From: Aaron Wolski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 05, 2004 1:01 PM
To: 'Jay Blanchard'; [EMAIL PROTECTED]
Subject: RE: [PHP] why this doesn't work as an external file but does
internally?




 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]
 Sent: October 5, 2004 3:52 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] why this doesn't work as an external file but does 
 internally?
 
[snip] 
 And the web has these JavaScript lists! Quaint, no?
[/snip]

If you look closely, it's tied in with PHP. But thanks your help!

[snip]
 Anyhow, to make this work you will need to generate your JavaScript
code
 with PHP.
[/snip]

If that was true then why does this work:

img1off = new Image();   img1off.src = ?php echo $base_url;
?Graphics/home_off.gif;

I certainly didn't generate it with PHP and it was included as an external
file.

Thanks!

A

-- 
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] Session.gc_maxlifetime?

2004-10-04 Thread Vail, Warren
This is my understanding;

When you use session_start(); in your script it sets a condition that will
cause a session write of the contents of the $_SESSION array to the session
repository (by default a file whose name contains the session ID) when the
script has ended.  At that time the record timestamp (file last modified
date/time) should be modified or reset to the current time.  To answer your
question below, I believe technically the timestamp is very close to the
script end time for a script containing a session_start() call (not the
actual time of the session_start() call is executed).

Periodically the gc (garbage cleanup) process is invoked, at which time all
sessions whose timestamp is checked to see how old they are and if they
precede the current timestamp minus the gc_maxlifetime value, they are to be
removed from the repository.

Notice that the processing above is accomplished when the script has ended
(sent it's last output to the browser).  By invoking the gc process at this
time it never has a direct impact on the response time or the users
experience, unless they are awfully fast with the mouse.  I have in the past
found that the GC routines are not invoked every invocation of a script, but
rather a probability factor causes the GC routine to be invoked on only
some percentage of the calls to session start to avoid adding needless load
to the server (i.e. say 10% of all script executions may trigger a call to
the GC routine).  To offset this I had to make sure that when
session_start() retrieved old session values (session_read), I had to add
checks to make sure I wasn't reading an old session that had expired but had
just not been cleaned up yet.

You can learn a lot about sessions by coding and testing your own
session_handler routines;

http://www.php.net/manual/en/function.session-set-save-handler.php

There are lots of other good tutorials in books on php programming.

Warren Vail


-Original Message-
From: Suhas [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 04, 2004 9:30 AM
To: php-general
Subject: [PHP] Session.gc_maxlifetime?


Hello,

I just want to make sure that I understand this concept.

When i read thr' docs,

session.gc_maxlifetime specifies the number of seconds after which data will
be seen as 'garbage' and cleaned up

and default value is 1440.

My guess is :

A.  1440 seconds from last visit to the page (where session id is used), 
B. 1440 seconds from session_start() function call

My general understanding is a session can be idle for 1440 seconds. If a php
page tried to refer to a session which is been idle more than 1440 seconds,
there is very little chance that page will access to session data.


Can any one please explain or send links or more docs on this?

Thanks in adv,

Suhas

-- 
Suhas Pharkute.

-- 
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] Session handlers

2004-10-01 Thread Vail, Warren
I have used MySQL sessions and session handler routines to perform the
following;

1.  I was able to set different session timeouts for different applications
as long as each application used a different session table.  The garbage
cleanup routines could be programmed to ignore the global session limit and
use different session life times for the different tables (a different set
of routines for each application).

2.  I was able to use session table to look over site users shoulders (so to
speak) and by watching key session variables was able to monitor who was
using different areas of the site.  Obviously this kind of thing would be
totally unmanageable for a public site, but on an intranet, I had phone
numbers for all users and when something got hung, I was able to identify
the user and give them a call while the problem was occurring.  I also used
this over the shoulder technique once to identify a hacker, and kicked him
off the site by deleting his session entry, forcing him to logon again,
course his password had been changed, and this only slowed him down for a
little while, but it sure felt good.

I'm sure there are many other uses, so I'll be watching this thread.

Warren Vail
(415) 667-0240
SF211-07-434
 


-Original Message-
From: Shawn McKenzie [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 01, 2004 5:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Session handlers


Just curious, what is the advantage of using a custom session handler, 
such as saving session data in MySQL?

TIA,
Shawn

-- 
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] choose upload folder

2004-09-21 Thread Vail, Warren
Marek is correct the behavior of the browse file selector is essentially a
client side thing, and not directly controllable from PHP.  One difficulty
is how to know when a directory is clicked because it is selected, or
clicked because the operator wanted the directory expanded, because he
wanted to select a directory inside that one.  If you can get past these
difficulties, you can always use the php function;

http://www.php.net/manual/en/function.dirname.php to make sure that you are
working with the dirname portion of a path.
http://www.php.net/manual/en/function.is-dir.php to make sure that the file
is a directory.

I am basically puzzled by what you are trying to do since you should not be
able to touch anything in the client's folders from your PHP server
application.  Perhaps what you meant to provide was a way for the user to
choose a directory on your server? In which case, the input type=file will
not work at all.  Where did you expect the user to select a directory/folder
from?  Your server or the user's browser machine?

Warren Vail
 


-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 21, 2004 2:46 PM
To: Joerg P
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] choose upload folder


Joerg P wrote:
 I have to be more specific:
 I dont want the file, I want the folder.

This happens on the client side, it has nothing to do with php.

You could possibly do it with signed java applets or activex scripts.

 
 Joerg
 
 
 Greg Donald wrote:
 
 On Tue, 21 Sep 2004 23:05:17 +0200, Joerg P [EMAIL PROTECTED] 
 wrote:

 I am building a script only for local use and would like the user to 
 choose a specific folder on his computer, to catalogize all files in 
 this folder.

 How do I let the user choose this folder?



 input type=file


 

-- 
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] thumbnail of webpage

2004-09-17 Thread Vail, Warren
I have been looking into this over the last week and have come up blank as
well.  Doing this manually is simple, point your browser to your URL, and in
windows use altprint Scrn to copy an image of the rendering in the
browser to the scratch-pad, then paste the image into a tool like paint to
cut out the part of the image you want, and use the skew/stretch tool in
paint to create the thumbnail (GD is a good solution as well) saving the
file as a jpg image.

The difficulties with php is that opening the URL with fopen or using CURL
allows getting the content of a page in html form, but provides no bitmap
rendering of all that, let alone allowing JavaScript to alter the
presentation as it would in a browser.

What would be useful, if there were a way to open the URL in an IFRAME, and
with JavaScript somehow capture a bitmap of the rendering of the web page,
perhaps encoding the bitmap as mod64 characters and placing the result in a
textarea for posting as input to a php script.  This was the best solution
that I could come up with but I don't have the skills to make this happen,
yet.  Question for anyone here, is does this sound like a path that might
work?  Can JavaScript access the rendered content of a webpage in window
bitmap form?

In my travels, someone had suggested coding something using mozilla and
invoking it from a php script, but no one has done this yet that I can
determine.

Warren Vail


-Original Message-
From: Jason Davidson [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 17, 2004 6:08 PM
To: Michael Mao; [EMAIL PROTECTED]
Subject: Re: [PHP] thumbnail of webpage


First, im not sure how you would capture a snapshot of the page, sinse the
page is rendered by the browser, and php is completely server side.
Possibly there is a way to fopen a page or something, but... i dunno..

as for making thumbnail, using the gd extension, is quite easy. check the
manual for GD. 

Jason


Michael Mao [EMAIL PROTECTED] wrote: 
 
 Is there a way to capture a snapshot of a html page and save it as a 
 jpg
 using php?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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

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



RE: [PHP] fopen problem, 5 line script

2004-09-15 Thread Vail, Warren
I thought filesize required the file name, and not the fileptr???

Warren Vail


-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 15, 2004 10:17 AM
To: php php
Subject: Re: [PHP] fopen problem, 5 line script


* Thus wrote Mag:
 Hi,
 Can someone tell me what I am doing wrong here please?
 
 ?php
 $fileptr =
 fopen(http://www.google.com/index.html,r;);
 
 $contents = fread($fileptr, filesize($fileptr));
...
 
 This is the error I get:
 Warning: filesize(): Stat failed for Resource id #1
 (errno=2 - No such file or directory) in 
 /home/quickxxx/public_html/tpg/ check- remote.php on line 4
 
 Warning: fread(): Length parameter must be greater
 than 0. in /
 home/quickxxx/public_html/tpg/check-remote.php on line

filesize() relies on the fact that the file you opened has support for
stat(). the http wrapper does not have such a thing.

see:
  http://php.net/filesize
  http://php.net/wrappers.http


Curt
-- 
The above comments may offend you. flame at will.

-- 
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] iguanahost - anyone else being plagued?

2004-09-15 Thread Vail, Warren
Could it be that lizards are nocturnal? ;-)

Warren Vail


-Original Message-
From: Jim Grill [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 15, 2004 10:05 AM
To: Nick Wilson; php-general
Subject: Re: [PHP] iguanahost - anyone else being plagued?


 Anyone else getting these infuriating italian messages about some 
 muppet that doesnt exist?

 'desintione non existente'?

 I've written to [EMAIL PROTECTED] but no joy, everytime i post on 
 the php list i get half a dozen of the damn things...
 --
 Nick W


I've been getting those stupid things too. Is that Italian? I thought it was
Spanish. LOL

-- 
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] Capturing an Image of a web page

2004-09-14 Thread Vail, Warren
Has anyone run across a tool available to PHP that can render an image of a
entire webpage from a URL, so that it can be reduced to a thumbnail and
stored in a database?
 
Warren Vail
 
 


RE: [PHP] Adding +7 more days on date() value problem

2004-09-10 Thread Vail, Warren
I believe this one will be off by an hour on leap day.

Warren Vail


-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 1:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Adding +7 more days on date() value problem


Why would you do such strange things? It's a lot more simple :P

$now = time();
$plus7 = $now+(7*24*60*60); // 7 days, containing 24 hours each, 
containing 60 minutes each, containing 60 seconds each.

echo 'Current Date: '.date('Y-m-d', $now);
echo 'Date in 7 days: '.date('Y-m-d', $plus7);

now isn't that easier ;)

Trevor Gryffyn wrote:

 I disagree on the strtotime recommendations that everyone else gave. 
 The mktime() function itself will compensate for leap years, day = 
 36 type stuff and all of that.
 
 ?php
 $curdate = date(Y-m-d);
 $plus7 = date(Y-m-d,mktime(0,0,0,date(m),date(d)+7,date(Y)));
 Echo Current Date: $curdatebr;
 Echo +7 Dats Date: $plus7;
 ?
 
 
 Simple as that!
 
 -TG
 
 
-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 11:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Adding +7 more days on date() value problem


I can't figure how could i add +7 more days on the DD (Day) value. My 
problem is, when the day is close on the end of the month like

07/29/2004

when i add +7 on 29 = 36, its obvious we dont have 36 on the calendar. 
And im creating a program below, to explode it and maybe just add +. 
But i think its useless if im just going to do + on the DD (Day) 
value.

Hmm :?

##
?php
$curdate = date(Y-m-d);
$plus7 = explode(-, $curdate);

print (
pcut:
 .$plus7[0]. 
 .$plus7[1]. 
 .$plus7[2]. 
/p

Current Date: $curdatebr
+7 Dats Date: $plus7

);
?
##

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

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

 
 

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

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



RE: [PHP] Adding +7 more days on date() value problem

2004-09-10 Thread Vail, Warren
So if this is run on the 30th of the month, you are saying this handles a
month with day 37 correctly?

Warren Vail


-Original Message-
From: Gryffyn, Trevor [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 11:58 AM
To: [EMAIL PROTECTED]
Cc: Louie Miranda
Subject: RE: [PHP] Adding +7 more days on date() value problem


I disagree on the strtotime recommendations that everyone else gave. The
mktime() function itself will compensate for leap years, day = 36 type
stuff and all of that.

?php
$curdate = date(Y-m-d);
$plus7 = date(Y-m-d,mktime(0,0,0,date(m),date(d)+7,date(Y)));
Echo Current Date: $curdatebr;
Echo +7 Dats Date: $plus7;
?


Simple as that!

-TG

 -Original Message-
 From: Louie Miranda [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 27, 2004 11:31 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Adding +7 more days on date() value problem
 
 
 I can't figure how could i add +7 more days on the DD (Day) value. My 
 problem is, when the day is close on the end of the month like
 
 07/29/2004
 
 when i add +7 on 29 = 36, its obvious we dont have 36 on the calendar. 
 And im creating a program below, to explode it and maybe just add +. 
 But i think its useless if im just going to do + on the DD (Day) 
 value.
 
 Hmm :?
 
 ##
 ?php
 $curdate = date(Y-m-d);
 $plus7 = explode(-, $curdate);
 
 print (
 pcut:
  .$plus7[0]. 
  .$plus7[1]. 
  .$plus7[2]. 
 /p
 
 Current Date: $curdatebr
 +7 Dats Date: $plus7
 
 );
 ?
 ##
 
 --
 Louie Miranda
 http://www.axishift.com
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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

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



RE: [PHP] Adding +7 more days on date() value problem

2004-09-10 Thread Vail, Warren
Actually, I stand corrected on this one, it will be off by an hour on
daylight savings change date (either one).

Warren Vail


-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 1:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Adding +7 more days on date() value problem


Why would you do such strange things? It's a lot more simple :P

$now = time();
$plus7 = $now+(7*24*60*60); // 7 days, containing 24 hours each, 
containing 60 minutes each, containing 60 seconds each.

echo 'Current Date: '.date('Y-m-d', $now);
echo 'Date in 7 days: '.date('Y-m-d', $plus7);

now isn't that easier ;)

Trevor Gryffyn wrote:

 I disagree on the strtotime recommendations that everyone else gave. 
 The mktime() function itself will compensate for leap years, day = 
 36 type stuff and all of that.
 
 ?php
 $curdate = date(Y-m-d);
 $plus7 = date(Y-m-d,mktime(0,0,0,date(m),date(d)+7,date(Y)));
 Echo Current Date: $curdatebr;
 Echo +7 Dats Date: $plus7;
 ?
 
 
 Simple as that!
 
 -TG
 
 
-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 11:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Adding +7 more days on date() value problem


I can't figure how could i add +7 more days on the DD (Day) value. My 
problem is, when the day is close on the end of the month like

07/29/2004

when i add +7 on 29 = 36, its obvious we dont have 36 on the calendar. 
And im creating a program below, to explode it and maybe just add +. 
But i think its useless if im just going to do + on the DD (Day) 
value.

Hmm :?

##
?php
$curdate = date(Y-m-d);
$plus7 = explode(-, $curdate);

print (
pcut:
 .$plus7[0]. 
 .$plus7[1]. 
 .$plus7[2]. 
/p

Current Date: $curdatebr
+7 Dats Date: $plus7

);
?
##

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

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

 
 

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

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



RE: [PHP] remote script execution

2004-09-07 Thread Vail, Warren
Ignoring PHP for a moment; to execute a string of commands on a remote
machine using ssh you would execute the following;

Promptssh -l user ps -ef|grep edit;cd /usr/local/bin;ls -la

Which would result in showing any edit processes, followed by a listing of
the contents of the /usr/local/bin directory.

Notice that I did not include a password (this is not needed if the two
servers have already exchanged security keys), and as near as I know, cannot
be supplied unless you are there to type it in on a tty type device, so be
sure to get the keys setup properly.  You will also need the client program
ssh installed on the originating machine, and the daemon sshd installed
on the remote machine, but then you probably knew that ;-)

In PHP simply;

$cmd = ssh -l user \ps -ef|grep edit;cd /usr/local/bin;ls -la;
$rtn = exec($cmd, $responselines);

http://us4.php.net/manual/en/function.exec.php

$responselines is now an array containing lines of output from the commands.

Hope this helps,

Warren Vail


-Original Message-
From: Sean Smith [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 07, 2004 11:43 AM
To: Vail, Warren
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] remote script execution


Warren,

I use ssh on all of my servers for logging in remotely. My next 
question would be, how do I connect to the remote server to run commands 
through PHP? Do I need to setup a socket or something? Could you provide 
me a pseudo sample or maybe point me to some docs. I've never had to do 
this type of thing in PHP before and I want to make sure I do it right. 
Thanks.

Sean

Vail, Warren wrote:

I've done a number of these and the choice depends on many things but 
perhaps the biggest factor is;

Is server 1 and server 2 behind the same firewall or are they exposed 
to the internet?

Behind a firewall you can probably get away with running any one of the 
following commands to remotely execute your script on server 2, from 
server 1;

Rexec, rsh, rpc, just to name 3.  The client part of the protocol is 
required on server 1 and the daemon part needs to be running on server 
2.

Across the open internet, be very careful here, I would think the 
choice would be ssh (secure shell).  This has several nice features 
that could be useful internally as well.  You start out by exchanging 
encryption keys between the two servers and because of this handshake, 
each server trusts the other in a way that the correct execution 
permissions can be established on server 2, and of course the data sent 
between the servers is encrypted rendering it virtually useless to 
third parties.  Google for ssh for more info.

Warren Vail


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



RE: [PHP] remote script execution

2004-09-03 Thread Vail, Warren
I've done a number of these and the choice depends on many things but
perhaps the biggest factor is;

Is server 1 and server 2 behind the same firewall or are they exposed to the
internet?

Behind a firewall you can probably get away with running any one of the
following commands to remotely execute your script on server 2, from server
1;

Rexec, rsh, rpc, just to name 3.  The client part of the protocol is
required on server 1 and the daemon part needs to be running on server 2.

Across the open internet, be very careful here, I would think the choice
would be ssh (secure shell).  This has several nice features that could be
useful internally as well.  You start out by exchanging encryption keys
between the two servers and because of this handshake, each server trusts
the other in a way that the correct execution permissions can be established
on server 2, and of course the data sent between the servers is encrypted
rendering it virtually useless to third parties.  Google for ssh for more
info.

Warren Vail

-Original Message-
From: Sean Smith [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 03, 2004 1:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] remote script execution


Scenario:

Server 1 is a LAMP webserver

Server 2 is an email server

I have a php script on server 2 that creates user accounts. It works 
great when your logged into the server and running it from the CLI.

I have a GUI on server 1 that is used to input user info into a database.


Question:

What I'd like to do is have server 1 call the script on server 2 and 
have server 2 return a variable back to server 1 to be displayed and 
ultimately entered into the database. If you understand my rambling 
above and have any insight into how to get this accomplished, it would 
be greatly appreciated. Thank you.

Sean

-- 
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] how can I get the fileversion?

2004-09-03 Thread Vail, Warren
Pedro,

Your question is difficult to answer because it is not specific enough.

First I tried to identify what you meant by version number.  I tried right
clicking on the desktop, no version number.  I opened windows explorer and
tried right clicking on a file listed there, and got modification dates, but
no version number.  I opened an internet explorer and right clicked on a
blank area of the page in the browser window, and properties there did not
show me version number.

Here is the difficulty, the interface most often used to respond to clicks
is a GUI, and PHP doesn't have a GUI, unless you are considering GTK, which
you didn't mention.  Typical web based applications (like those programmed
in PHP) use the web browser as it's GUI, and since PHP only responds to
clicks as defined in HTML (not sure how you'd get right clicks).

Your question asked about Windows and PHP and to get a good answer, you
probably need to be more specific about each.  Where in windows do you see
your version number?

Hope this helps,

Warren Vail

-Original Message-
From: Pedro Irán Méndez Pérez [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 03, 2004 3:09 PM
To: John Nichel
Cc: Lista de Php-General
Subject: RE: [PHP] how can I get the fileversion?


Thank you for your help, My question is:

How can I know the version of a file, I mean, in Windows if you press click
with the mouse right button you can see the file properties, in those
properties you can see the version.

how can I see, the same thing in php?

 =
¿Acaso se olvidará la mujer de su bebé, y dejará de compadecerse del hijo
de su vientre? Aunque ellas se olviden, yo no me olvidaré de ti

Isa 40:27
 =

Atte   Pedro Irán Méndez Pérez


-Mensaje original-
De: John Nichel [mailto:[EMAIL PROTECTED]
Enviado el: Viernes, 03 de Septiembre de 2004 01:10 p.m.
CC: [EMAIL PROTECTED]
Asunto: Re: [PHP] how can I get the fileversion?


Pedro Irán Méndez Pérez wrote:
 Hello everybody, I am a new in this list, and I can´t find the form of
read
 from file his file version, I am working with php  4.3.2, Apache 
 1.3.x, Win32 (XP).

 Can you help me??

 PD. Sorry for my english, but I am Mexican :)

  =
 ¿Acaso se olvidará la mujer de su bebé, y dejará de compadecerse del 
 hijo de su vientre? Aunque ellas se olviden, yo no me olvidaré de ti

 Isa 40:27
  =

 Atte   Pedro Irán Méndez Pérez


Hi Pedro,

   Not that I don't want to help you, but with our language differences, I'm
not sure I know what you're asking.  On this page, there is a Spanish PHP
Mailing list which may be of more help to you.  Good luck!

http://us4.php.net/mailing-lists.php

--
John C. Nichel
ÜberGeek
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

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



RE: [PHP] php does not get variable values in POST method

2004-09-02 Thread Vail, Warren
That is because the option register globals was deprecated in later
releases (provided a way for hackers to alter variables not even on your
form).

Suggest you code each reference to a form variable as $_POST[varname]
(assuming you are using the form post method).

Warren Vail


-Original Message-
From: Leticia Campos [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 9:04 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] php does not get variable values in POST method


I developed an html/php form  in a Php version 4.0.6, working fine, but when
a moved the files to another web server with Php 4.3.2 the file
procesaadmision.php called in the Post method does not get any of the input
html variables defined in the calling form. form
ACTION=procesaadmision.php METHOD=POST 

Thanks for any help

Leticia Campos
IT Programming

-- 
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] Weblog -Blog software wrtten in PHP and My SQL

2004-08-31 Thread Vail, Warren
PHP Nuke includes BLOG's and a lot more (referred to as Journals in the
App).

http://www.phpnuke.org


Warren Vail


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 10:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Weblog -Blog software wrtten in PHP and My SQL


Does anyone know of Blog sw available in the marketplace written in PHP and 
maybe MySQL?

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



RE: [PHP] Weblog -Blog software wrtten in PHP and My SQL

2004-08-31 Thread Vail, Warren
Hmmm, I had one also that was hacked half dozen times (and a half dozen
sites that were never touched) till I installed security patches from
release 7.4, works great now.  What do you like about Wordpress?  Are the
themes changeable?

Warren Vail


-Original Message-
From: Xongoo!com: Central unit [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 11:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Weblog -Blog software wrtten in PHP and My SQL


I've used nuike for a year or so, it was hacked 3
times, blog script there is ugly. Wordpress rocks!

- Original Message -
From: Vail, Warren [EMAIL PROTECTED]
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, August 31, 2004 9:04 PM
Subject: RE: [PHP] Weblog -Blog software wrtten in
PHP and My SQL


 PHP Nuke includes BLOG's and a lot more
(referred to as Journals in the
 App).

 http://www.phpnuke.org


 Warren Vail


 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 31, 2004 10:28 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Weblog -Blog software wrtten in
PHP and My SQL


 Does anyone know of Blog sw available in the
marketplace written in PHP and
 maybe MySQL?

 --
 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] PHP- Dependant dropdown based on Mysql queries

2004-08-30 Thread Vail, Warren
You are presented with some difficult design choices and limitations.  The
way I believe you are envisioning things may not work.  

The problem that you face is that PHP only runs on the server when preparing
the page.

You are asking some interactions to take place once the web page is
presented by your browser, and JavaScript is the language of choice to make
this happen because it runs in your browser, however, it cannot access your
database directly (that I know of), so you are forced to go back to PHP
which must access the database again, and present a new, slightly different
page, reflecting your visitors choices so far (I don't believe there is a
way for PHP to update part of a page unless it is allowed to update a hidden
frame and JavaScript gets the new data from the hidden frame [a level of
complexity and risk I'd not want to take on]).

If the data required to support the choices is small enough (and you
indicated it was not), loading things into a JavaScript array, and letting
JavaScript step through the choices using the arrays would give the best
apparent response, but the choice almost becomes one of accepting a long
response to preload all the data in one page, or suffer the slow response of
having each menu selection have to go back to the server and rebuild the
page.

Good luck,

Warren Vail


-Original Message-
From: Francisco Puente XFMP (QA/EMC)
[mailto:[EMAIL PROTECTED] 
Sent: Monday, August 30, 2004 12:28 PM
To: Brent Clements; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP- Dependant dropdown based on Mysql queries


Hi Brent, 
I believe this is the way to go, but since I'm not a javascript guy
I would like to get some php help for doing this.
I you know some javascript can you please post some code for this
task?
Someone else proposed to query ALL the information from the database
to populate the javascript code to be used but I disregard this since the
data from the database is pretty big and a lot of user accessing at the sime
will put the load on the roof. I'm sure there is an easier way to go..
Thanks a lot!

Francisco


-Original Message-


Using a combination of javascript and php this is easily done. Below is just
a way off the top of my head. There are probably simpler ways of doing it or
even more elegant but again this is just off the top of my head.

You would populate your first dropdown box by whatever method. Then you
would do an onselect javascript event to submit the form, the php code would
check to see what step your at by seeing which select form field was
submitted and then take the value of select form field , query against the
value, and then use the results to populate the other select form fields.

Wash, rinse, repeat.

-Brent



- Original Message - 



 Hi All,
 I'm trying to generate a PHP page with 3 or 4 dropdown menus, each of 
 one
dependant upon each other, that means:
 #2 dropdown should change upon selecting something on dropdown #1, #3
should change based on the selection at #2 to finally submit the desired
query. Each dropdown menu should be generated from a mysql query based on
the previous selection.
 I need to generate mysql queries based on each dropdown selection and 
 the
page should reload the content for the next dropdown menu. I couldn't yet
figure out how to accomplish this.
 Let me know if I make myself clear enough :)
 Any help is very welcome!!

 Thanks in advance,

 Francisco

 --
 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] PHP- Dependant dropdown based on Mysql queries

2004-08-30 Thread Vail, Warren
I think you are coming to the compromise I've always had to make too.

Warren Vail


-Original Message-
From: Francisco Puente XFMP (QA/EMC)
[mailto:[EMAIL PROTECTED] 
Sent: Monday, August 30, 2004 1:44 PM
To: Vail, Warren
Cc: Brent Clements; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP- Dependant dropdown based on Mysql queries


Hi Vail, 
You are 100% correct on all the items you've mentioned.
That's why I'm trying to get the less painful solution for this. 
I believe I'll end up reloading the page on each selection since
I'll have only 3 or 4 dropdown menu to be processed by PHP and the server
response is good so far.
Kind regards,

Francisco




-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: August 30, 2004 4:32 PM
To: Francisco Puente XFMP (QA/EMC); Brent Clements;
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP- Dependant dropdown based on Mysql queries


You are presented with some difficult design choices and limitations.  The
way I believe you are envisioning things may not work.  

The problem that you face is that PHP only runs on the server when preparing
the page.

You are asking some interactions to take place once the web page is
presented by your browser, and JavaScript is the language of choice to make
this happen because it runs in your browser, however, it cannot access your
database directly (that I know of), so you are forced to go back to PHP
which must access the database again, and present a new, slightly different
page, reflecting your visitors choices so far (I don't believe there is a
way for PHP to update part of a page unless it is allowed to update a hidden
frame and JavaScript gets the new data from the hidden frame [a level of
complexity and risk I'd not want to take on]).

If the data required to support the choices is small enough (and you
indicated it was not), loading things into a JavaScript array, and letting
JavaScript step through the choices using the arrays would give the best
apparent response, but the choice almost becomes one of accepting a long
response to preload all the data in one page, or suffer the slow response of
having each menu selection have to go back to the server and rebuild the
page.

Good luck,

Warren Vail


-Original Message-
From: Francisco Puente XFMP (QA/EMC)
[mailto:[EMAIL PROTECTED] 
Sent: Monday, August 30, 2004 12:28 PM
To: Brent Clements; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP- Dependant dropdown based on Mysql queries


Hi Brent, 
I believe this is the way to go, but since I'm not a javascript guy
I would like to get some php help for doing this.
I you know some javascript can you please post some code for this
task?
Someone else proposed to query ALL the information from the database
to populate the javascript code to be used but I disregard this since the
data from the database is pretty big and a lot of user accessing at the sime
will put the load on the roof. I'm sure there is an easier way to go..
Thanks a lot!

Francisco


-Original Message-


Using a combination of javascript and php this is easily done. Below is just
a way off the top of my head. There are probably simpler ways of doing it or
even more elegant but again this is just off the top of my head.

You would populate your first dropdown box by whatever method. Then you
would do an onselect javascript event to submit the form, the php code would
check to see what step your at by seeing which select form field was
submitted and then take the value of select form field , query against the
value, and then use the results to populate the other select form fields.

Wash, rinse, repeat.

-Brent



- Original Message - 



 Hi All,
 I'm trying to generate a PHP page with 3 or 4 dropdown menus, each of
 one
dependant upon each other, that means:
 #2 dropdown should change upon selecting something on dropdown #1, #3
should change based on the selection at #2 to finally submit the desired
query. Each dropdown menu should be generated from a mysql query based on
the previous selection.
 I need to generate mysql queries based on each dropdown selection and
 the
page should reload the content for the next dropdown menu. I couldn't yet
figure out how to accomplish this.
 Let me know if I make myself clear enough :)
 Any help is very welcome!!

 Thanks in advance,

 Francisco

 --
 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] Browser back button

2004-08-27 Thread Vail, Warren
I struggled with this one as well and the solution is quite simple;

1.  Every PHP module that is reached via the action field in a form where
the method is POST (most of mine are) never outputs any html except a http
redirect (it will edit values, update the database, save session data, then
does a redirect).

header(Location:.);

2.  Every PHP module that is reached via a hotlink or redirect (above) is
free to output html to the browser, acting on or displaying data from the
database, using session data, or data coded in the URL parameter list;

Mymodule.php?parm1=parm2=parm3=

$a = $_GET[parm1];// like this
$b = $_GET[parm2];
$c = $_GET[parm3];

With these two types of modules, you can build your entire application.  I
believe the cause of this problem is that most browsers don't save POST
data in the history stack, when you click the back button and the browser
detects that the previous page was entered via a POST is knows it doesn't
have enough saved information to reconstruct the page (passed data is
missing, and complains).  I also believe the browser replaces an entry in
the history stack (i.e. your form POST) when it receives a redirect url,
effectively removing all url's that had been entered with a POST from the
history stack and replacing them with GET requests.

Good luck,

Warren Vail

-Original Message-
From: Michael Gale [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 27, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Browser back button


Hello,

I am sure this has been asked more then a few times but ... I have a
web site where almost every page is dynamically created. So if at some point
in the site if you hit your browsers back button a popup window occurs and
asks if you want to resubmit the data. Upon clicking yes the page is
properly displayed.

That is a pain in the a$$ and I get many user complaints -- so far I have
thought about saving the requested URL and query string in a session
variable and loading a back button on every page.

This seems to work create if the previous page can be loaded using a GET
request but if the previous page was loaded using a HTTP POST it seems I an
up the creek with out a paddle :(

Any one have any ideas ... 

Thanks ..

-- 
Michael Gale
Network Administrator
Utilitran Corporation

-- 
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] CSRF attack not possible in I.E. 6.01 SP1?

2004-08-16 Thread Vail, Warren
Perhaps the question could be asked another way and be more on topic.

Is there a fix in I.E. 6.01 that would interfere with PHP being able to
generate different mime types on the fly, like .png or .jpg

Thanks,

Warren Vail


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 16, 2004 10:57 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] CSRF attack not possible in I.E. 6.01 SP1?


[snip]
I am working on securing an application that uses CDSSO (Cross Domain 
Single Sign On). 

I am trying to reproduce the CSRF (Cross Site Request Forgery) attack 
(using img/ TAG) in I.E. 6.01,  but am unable to do so. However the 
attack works on Mozilla and other older browsers.

My question: Is I.E. 6.01 SP1 doing something to foil the CSRF attack, 
i.e. only allow image extensions .gif .png .jpeg?
[/snip]

You would have to ask the Microsoft Development Group, who probably does not
subscribe to this list. Crossposting is bad. Being OT during a crosspost is
even worse. I can hear the falmethrowers warming up in the wings.

FYI - This is (or use to be) a PHP list

-- 
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] PHP performance

2004-08-10 Thread Vail, Warren
If your problem is with a long running MySQL Query, and many of mine have
been, I would suggest you read

http://dev.mysql.com/doc/mysql/en/Optimizer_Issues.html

Your objective is to make sure that all your database queries avoid the
deadly table scan as a part of their query plan.

Good Luck,

Warren Vail


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 10, 2004 12:16 PM
To: Ed Lazor; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP performance


[snip]
Any recommendations on how to make PHP run faster?
[/snip]

A multiple CPU box. (It's a legitimate answer!)

-- 
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] CMS Ideas Welcome

2004-08-04 Thread Vail, Warren
I am hosting a few sites on PHPNuke and have modified PHPNuke to use the
HTMLArea JavaScript addon to allow textareas to be edited in wysiwyg
fashion, without having to deal with HTML.  Initial reaction seems to be
very favorable, especially the htmlarea version with the image manager
plugin.

http://www.phpnuke.org
http://www.zhuo.org/htmlarea/?view=flat

Warren Vail

-Original Message-
From: charles kline [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 04, 2004 1:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] CMS Ideas Welcome


Hi all,

I could use some advice/pointers on a sold method for achieving this 
feature on a site I am building. One of the features is an event 
calendar. The events are listed by date, not in a calendar view, but a 
list with a short description of the event. This part is no problem. 
What I am not sure about as far as a best method is the next part. 
Each event could have a longer description. The client wants to be able 
to style this longer description using formatting and images, but does 
not want to have to code the HTML into a textarea and then upload the 
images via ftp or whatever. The idea I came up with is to have a few 
pre-defined layouts they can choose from. Some of which could 
incorporate some images. Once the style is picked and the text is 
entered (different fields get different styles applied) the submit the 
data, and if the style makes images a part of the layout, I give them a 
form based image upload feature. Another thought was to have them 
upload .html files and the images via a form, but then I thought this 
could really cause problems if they had screwed up code.

Any thoughts would be greatly appreciated.

Thanks,
Charles

-- 
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: webserver response-time, how?

2004-08-04 Thread Vail, Warren
I support several PHPNuke sites and the page preparation time is measured by
taking a microtime stamp at the very beginning of the script and another
just before echoing the last couple of lines at the bottom of the page and
producing something like the following on the bottom of the page;

Page Generation: 0.376 Seconds

This does not measure all the elements of delay, however, which can be
broken down into the following;

1. Time it takes for browser to get the request packet to the web server.
2. Time it take the web server to begin processing the request.
3. Time it takes to load PHP and for PHP to load your script (CGI or MOD?)

4. Time it takes for your script to complete execution is measured above.

5. Time it takes for the cached output from your script to be delivered back
to the browser.
6. Time it takes to perform 1-5 above for any imbedded images, etc requests.
7. Time it takes for the browser to render the completed page.

It's not clear from your question, which of these you wanted to measure.  If
you were to develop another application running on your local machine, then
you could use things like socket connections to simulate a browser, invoke
the page and measure the total span of time.  In this case I would recommend
using CURL, or Pears HTTP_REQUEST instead of dealing with the intricacies of
building the request, etc.

Hope this helps,

Warren Vail


-Original Message-
From: Tobias Grønlund [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 04, 2004 4:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: webserver response-time, how?


M. Sokolewicz wrote:

 Tobias grønlund wrote:
 
 Im trying to find a way of getting the responsetime from a remote
 webserver before it actually starts sending some output for your 
 browser to read. Any ideas??
 
 try timing the fsockopen() or (whatever you use) call. :) That'll give
 you a reasonable estimate.
 
 - Tul
 
how do i do that??

-- 
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: webserver response-time, how?

2004-08-04 Thread Vail, Warren
I could be wrong, but I don't think it measures all the time you want.  

The fsockopen will measure the time it takes to resolve the dns entry, and
open the socket, but it does not measure the time it takes to get the
request to the server (you could send the request thru your socket and if
you are doing blocked transfers, the question becomes, when does the server
acknowledge receipt of your request, immediately or by sending the finished
page? Don't know enough about web servers and http to be sure).  

The other factor you are trying to measure is how much delay is there in the
server between the receipt of the request and the beginning of processing.
If PHP is being run as a CGI on this server, then the server will need to
load PHP, which will then load your script, which will then begin executing
your script (any one of these events could be defined as beginning
processing), and almost impossible to measure.  An idle server will begin
your process without any delay, but if you are concerned about this response
time, I'm guessing the server is not idle.

You have a tough problem, wish I could offer more help,

Warren Vail


-Original Message-
From: Tobias Grønlund [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 04, 2004 5:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: webserver response-time, how?


i meant time from i send the requestpacket to the server begins 
processing the request, but i think that i have found a sollution now. 
I've used microtime() to time how long it took to make a fsockopen() on 
the webpage... schouldnt the output then be showing the result of my 
problem??

Warren Vail wrote:
 I support several PHPNuke sites and the page preparation time is 
 measured by taking a microtime stamp at the very beginning of the 
 script and another just before echoing the last couple of lines at the 
 bottom of the page and producing something like the following on the 
 bottom of the page;
 
 Page Generation: 0.376 Seconds
 
 This does not measure all the elements of delay, however, which can be 
 broken down into the following;
 
 1. Time it takes for browser to get the request packet to the web 
 server. 2. Time it take the web server to begin processing the 
 request. 3. Time it takes to load PHP and for PHP to load your script 
 (CGI or MOD?)
 
 4. Time it takes for your script to complete execution is measured 
 above.
 
 5. Time it takes for the cached output from your script to be 
 delivered back to the browser. 6. Time it takes to perform 1-5 above 
 for any imbedded images, etc requests. 7. Time it takes for the 
 browser to render the completed page.
 
 It's not clear from your question, which of these you wanted to 
 measure.  If you were to develop another application running on your 
 local machine, then you could use things like socket connections to 
 simulate a browser, invoke the page and measure the total span of 
 time.  In this case I would recommend using CURL, or Pears 
 HTTP_REQUEST instead of dealing with the intricacies of building the 
 request, etc.
 
 Hope this helps,
 
 Warren Vail
 
 
 -Original Message-
 From: Tobias Grønlund [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, August 04, 2004 4:20 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: webserver response-time, how?
 
 
 M. Sokolewicz wrote:
 
 
Tobias grønlund wrote:


Im trying to find a way of getting the responsetime from a remote 
webserver before it actually starts sending some output for your 
browser to read. Any ideas??

try timing the fsockopen() or (whatever you use) call. :) That'll give 
you a reasonable estimate.

- Tul

 
 how do i do that??
 

-- 
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: webserver response-time, how?

2004-08-04 Thread Vail, Warren
One thing you can count on this list, if I say something incorrect, it will
get corrected, so stay tuned.

I had made some assumptions that perhaps I shouldn't have.  I assumed that
your remote server was a typical machine running apache, php, mysql, and
lots of other stuff.

I don't believe pings are answered by the apache server daemon, which I
think is what you are trying to measure.  I believe pings are responded to
at a very primitive level within the tcp/ip software, for example you may
get a successful ping on a server, but the apache web server could be shut
down.  I think pings even use a different tcp/ip port number.

Suppose you did this;

Create a simple page on the remote server that echoes a short page, small
enough to fit in a single packet if possible.  Something like;

?php echo Hello; ?

You write an application to run on your local machine, perhaps also using
php;

?php
For($x=0; $x1; $x++) {
$s = microtime();
$fp = fopen(remoteurl,r);
$page = fread($fp,1);
$f = microtime();
 At this point you will need to process the microtime to determine
elapsed time
$accum += $elapsed;
}
... At this point $x contains number of hits and $accum will give you total
time
... You can get the average time from this

In this example you've minimized the amount of execution time and transfer
time for the page by making it small, so most of elapsed time will be the
response time you are looking for.  By using a php script at the remote end,
you are measuring the load times, if any for PHP and your Script.

If the time clocks were exactly in sync on both servers, you could have the
remote page echo the microtime on that server, and you could compare the
two, but since they are probably very different, that will not work.
Somehow I think coming close is the best you are going to be able to do.

Good luck,

Warren Vail

-Original Message-
From: Tobias Grønlund [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 04, 2004 5:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: webserver response-time, how?


okey, i had a hunch that my sollution was to easy to be the right one...

How about timing a ping sent to the server (e.g. like pinging a person 
on irc), could that be possible, or is there flaws in that plan to???

Warren Vail wrote:
 I could be wrong, but I don't think it measures all the time you want.
 
 The fsockopen will measure the time it takes to resolve the dns entry, 
 and open the socket, but it does not measure the time it takes to get 
 the request to the server (you could send the request thru your socket 
 and if you are doing blocked transfers, the question becomes, when 
 does the server acknowledge receipt of your request, immediately or by 
 sending the finished page? Don't know enough about web servers and http to
be sure).
 
 The other factor you are trying to measure is how much delay is there 
 in the server between the receipt of the request and the beginning of 
 processing. If PHP is being run as a CGI on this server, then the 
 server will need to load PHP, which will then load your script, which 
 will then begin executing your script (any one of these events could 
 be defined as beginning processing), and almost impossible to measure.  
 An idle server will begin your process without any delay, but if you 
 are concerned about this response time, I'm guessing the server is not 
 idle.
 
 You have a tough problem, wish I could offer more help,
 
 Warren Vail
 
 
 -Original Message-
 From: Tobias Grønlund [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, August 04, 2004 5:14 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: webserver response-time, how?
 
 
 i meant time from i send the requestpacket to the server begins
 processing the request, but i think that i have found a sollution now. 
 I've used microtime() to time how long it took to make a fsockopen() on 
 the webpage... schouldnt the output then be showing the result of my 
 problem??
 
 Warren Vail wrote:
 
I support several PHPNuke sites and the page preparation time is
measured by taking a microtime stamp at the very beginning of the 
script and another just before echoing the last couple of lines at the 
bottom of the page and producing something like the following on the 
bottom of the page;

Page Generation: 0.376 Seconds

This does not measure all the elements of delay, however, which can be
broken down into the following;

1. Time it takes for browser to get the request packet to the web
server. 2. Time it take the web server to begin processing the 
request. 3. Time it takes to load PHP and for PHP to load your script 
(CGI or MOD?)

4. Time it takes for your script to complete execution is measured
above.

5. Time it takes for the cached output from your script to be
delivered back to the browser. 6. Time it takes to perform 1-5 above 
for any imbedded images, etc requests. 7. Time it takes for the 
browser to render the completed page.

It's not clear from your 

RE: [PHP] running a script

2004-08-03 Thread Vail, Warren
Sounds like a good plan, but if this is outside a firewall on the open
internet, it could present some security risks.  I'll assume for the moment
that it's not.

If your script that sends the email can store the information from the form
into the database and assign it a unique number, then your hotlink on the
email only needs to have the number.  

My expectation would be, that after giving this some thought you will decide
you need the person receiving the email to have the ability to change some
of the data on the email.

Another approach might be to send an email alert that contains a url to a
page that presents a list of pending requests, and your user could then
authorize several at once.

I also know you can send an email form in html (you can google for help on
this one), but I am not sure if the form can post the data, perhaps if the
person receiving email is using outlook, don't know.

Hope this stimulates a few more options,

Warren Vail


-Original Message-
From: Aaron Todd [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 03, 2004 10:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] running a script


The program I am working on so far will take input from a form and email it
out.  This information needs to be verified by a human and then somehow the
human that verifys the info needs to click some link in order to for all
that data to be entered into an SQL database.

I was thinking of somehow having a link in the email so when I click on it,
it runs a script that will enter all my info into the database.

Any help/suggestions is appreciated.

Thanks,

Aaron


John Nichel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Tuesday 03 August 2004 12:25, Aaron Todd offered up the following tid-bit
of information :
 Is there any way to run a php script by clicking a link?

 Thanks,

 Aaron

Anytime you click on a link to a php document, you are 'running' a php
script.  Could you be a bit more specific as to what you want to do?

-- 
John C. Nichel
ÜberGeek
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] javascript type cast

2004-08-03 Thread Vail, Warren
I, for one, am not convinced that this all that far off topic.

Since the accepted method to generate browser interaction with server side
PHP, is to use Javascript, it doesn't seem any more off-topic than dealing
with database questions about MySQL.

I am probably like most PHP developers, with a very weak knowledge of
Javascript, and while that makes the question feel like being off-topic,
I'm not sure it should be.  I wish I knew of another list I could recommend
as a resource for Javascript, but I don't, and that is probably a result of
knowing so little.

Only abuse occurring here, IMHO is the content police's treatment of Josh.

Warren Vail


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 03, 2004 10:13 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] javascript type cast


On Wednesday 04 August 2004 01:06, Josh Close wrote:
 Wow, no need to be an ass. I just wanted a little help and this list 
 is usually pretty friendly and willing to help. but I guess not.

So you're saying you're taking advantage of (or abusing) the list's
readiness 
to help by asking OT questions?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The enemy diversion you're ignoring is their main attack
-- Murphy's Military Laws n79
*/

-- 
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] First day of the month

2004-08-03 Thread Vail, Warren
I was going to suggest;

$dayofweek = date(D,strtotime(date(Y-m-01)));

Warren Vail


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 03, 2004 11:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] First day of the month


On Tuesday 03 August 2004 13:46, David Hansen Jr. offered up the following 
tid-bit of information :
 I'm trying to make a custom calendar script for my school district, 
 and I'm hitting a little obstacle.  I know how I can accomplish what 
 I'm after, but it's a lot of extra coding.  I'm wondering if there's a 
 simple way to figure out what day of the week the first day of the 
 month lands on.  I can take the info pulled with date() and use 
 several
 switch() and if statements, but that's ugly.  Anyone have any
 suggestions?

 Thanks!
 ~ David

$firstDayOfMonth = mktime (0,0,0, $month, 1, $year );

http://us4.php.net/mktime
-- 
John C. Nichel
ÜberGeek
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] [Q] Converting SQL Datetimes to timestamps

2004-08-03 Thread Vail, Warren
Try reversing the order in the date to -mm-dd and I believe it should
work.

Keep in mind that the time variable $ts is not the same as a Mysql timestamp
for example.  It conforms to the unix epoch time variable.

Warren Vail


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael T. Peterson
Sent: Tuesday, August 03, 2004 11:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] [Q] Converting SQL Datetimes to timestamps


Evidently the strtotime() function will not convert an SQL datetime to a
timestamp. Am I missing something? Here's an example of what I mean:

$sql_datetime = '1948-30-03 01:30:00';
$ts = strtotime( $sql_datetime );
print( $ts.'br');

When this script is executed, strtotime() returns -1.

If true, that strtotime() is unable to convert SQL datetimes into
timestamps, how are others accomplishing this?

Cheers,

Michael

-- 
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: php coding software

2004-08-02 Thread Vail, Warren
For what it's worth, I use HTML-Kit as well.  Feature I like best is the
ability to seamlessly edit content of remote sites and local (folder based)
sites.

Warren Vail


-Original Message-
From: Harlequin [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 02, 2004 5:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: php coding software


Brad

I use HTML-Kit for HTML, ASP, Java, CSS, PHP and MySQL.

Free too :)

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
Brad Ciszewski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Does anyone know any good software for PHP/mysql coding? I currently 
 use DreamWeaver MX, however it doesn't have much PHP support, and no 
 MySQL support. I just want an easy program to script in, and upload on 
 to my webserver. Please help! :o


-- 
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] php paypal

2004-07-27 Thread Vail, Warren
Did you think of saving the information (invoice number) in a session or
cookie before sending them off to paypal, for use when the user returns?

Warren Vail


-Original Message-
From: Mike R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 27, 2004 8:51 AM
To: Jason Davidson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] php  paypal



That's trueI didn't even think of that.  Not a cc number, but, say, an
invoice number that the person starts with before they go off to paypal and
return from paypal with the same invoice number so that I can then do more
things with the user (the invoice number being unique).

:)

Thanks,

-Mike




 Might be easier to use session vars to track whatever it is your 
 tracking.

 Jason

 On Tue, 27 Jul 2004 11:11:31 -0400, Mike R 
 [EMAIL PROTECTED] wrote:
 
  Does anyone know if it is possible to pass a variable in the URL to 
  the return page when using paypal?
 
  Meaning, when someone is done a transaction in paypal and they
 return the
  merchant's site, can a variable be passed all of the way
 through back to the
  merchant's site?
 
  :)
 
  -Mike
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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

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



RE: [PHP] Showing all users who are logged in

2004-07-27 Thread Vail, Warren
I did one application where I used the PHP session table to tell who was
logged on, and which area of the application they were most recently in.
One of several flaws, was that I used Kill session to logoff, and that
caused them to disappear from any count of users logged on.  Course, if they
had logged off, then they weren't logged on, but on the other side, users
were counted for every session they created, and closing and opening new
browser sessions caused them to be counted multiple times, and continue to
be counted until session garbage cleanup removed their session entries,
unless I used the session timestamp in my count algorithm.  Session was
nice, because if a user was causing a problem, I could kill his session
entry, effectively logging him off, forcing him to logon again.

Warren Vail


-Original Message-
From: Justin Patrin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 27, 2004 5:05 PM
To: Jason Giangrande
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Showing all users who are logged in


On Tue, 27 Jul 2004 19:55:49 -0400, Jason Giangrande [EMAIL PROTECTED]
wrote:
 Anyone have any suggestions as to the best way to keep track of all 
 users who are logged in at a given time?  I thought of writing them to 
 a temp text file and them deleting the names from the file when a user 
 logged out, but I think there has to be a better way.  Anyone have any 
 suggestions?
 

Save when a user logs in to the DB. Or whenever they access a page. Clear
them out after x minutes and no activity.

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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

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



RE: [PHP] Include path

2004-07-23 Thread Vail, Warren
Have you tried;

Include ../templates/header.php;

Warren Vail

-Original Message-
From: PHP Gen [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 23, 2004 12:28 PM
To: Jay Blanchard; php php
Subject: RE: [PHP] Include path


--- Jay Blanchard
[EMAIL PROTECTED] wrote:
 [snip]
 /home/sites/site80/web/articles/myfile.php
 
 from myfile.php I want to include header.php
 which
 is located in:
 
 /home/sites/site80/web/templates/
 
 /*
 
 eg:
 /home/sites/site80/web/articles/myfile.php
 /home/sites/site80/web/templates/header.php
 
 */
 [/snip]
 
 in /home/sites/site80/web/articles/myfile.php
 
 place the following line
 
 include
 /home/sites/site80/web/templates/header.php;
 



:-)

Good solution, but the problem is once the program is
completed it goes out of my hands and most prolly the
client wont know the exact paths, the templates folder
would *always* be one below...but the path before the /templates will
change.

Anyway, heres what I have come up with, comments are
welcome:

$pieces = explode(/, $_SERVER[PATH_TRANSLATED]); $a=count($pieces);
$f=; for($i=1; $i  $a-2; $i++) {$f=$f.$pieces[$i]./;} $include_path=
/.$f;

-Mag


=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)




__
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

-- 
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] textarea/display question...

2004-07-20 Thread Vail, Warren
Have you considered an imbedded frame?  (Looks like a textarea, with the
ability to imbed all types of controls (and tables) within it).  I'm not
sure that all browsers support IFRAME yet, but the most widely used one
does.

Another approach would be to use sprinf() formatting to imbed
leading/trailing spaces to allow everything to line up, assuming your text
area uses a fixed pitch font like courier.  Course since the control is an
input control, trust your users are going to screw up the alignment, and
don't count on getting the data back all neatly lined up.

Warren Vail


-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 20, 2004 10:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] textarea/display question...


hi..

i'm presenting a textarea to the user...

i'd like to be able to display the information within the textarea in a
table format. this would allow me to highlight the material that the user
should modify. however, i can't figure out how to accomplish this...

$foo = 'tabletrtd class='red'blah/td/tr/table';
textarea value='$foo'/textarea

something like the above, but without displaying all the attrib stuff...

any ideas/pointers would be appreciated..

thanks

-bruce

-- 
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] textarea/display question...

2004-07-20 Thread Vail, Warren
Yes, but by nature, it must be a separate form.  What appears in the IFRAME
is like any other frame, an entire web page, and as a separate web page and
separate form, it must have it's own submit button (within the form).
Course you could cause some of the other controls on the form to trigger the
submit, like changing a selection on a select list;

select name=fmyselect onChange=this.form.submit();
option value='a'this is a/option
/select

Hope this helps,

Warren Vail


-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 20, 2004 11:51 AM
To: Vail, Warren; [EMAIL PROTECTED]
Subject: RE: [PHP] textarea/display question...


vail...

with an iframe... can i allow the user to make changes... and then capture
the data as a value for a post within a form..???

in other words...does it closely give me what a textarea does with regards
to allowing a user to make mods to the information?

-thanks..

ps.. to you guys who said that the textarea doesn't have a value=''.. it
does...



-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 11:20 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] textarea/display question...


Have you considered an imbedded frame?  (Looks like a textarea, with the
ability to imbed all types of controls (and tables) within it).  I'm not
sure that all browsers support IFRAME yet, but the most widely used one
does.

Another approach would be to use sprinf() formatting to imbed
leading/trailing spaces to allow everything to line up, assuming your text
area uses a fixed pitch font like courier.  Course since the control is an
input control, trust your users are going to screw up the alignment, and
don't count on getting the data back all neatly lined up.

Warren Vail


-Original Message-
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 10:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] textarea/display question...


hi..

i'm presenting a textarea to the user...

i'd like to be able to display the information within the textarea in a
table format. this would allow me to highlight the material that the user
should modify. however, i can't figure out how to accomplish this...

$foo = 'tabletrtd class='red'blah/td/tr/table';
textarea value='$foo'/textarea

something like the above, but without displaying all the attrib stuff...

any ideas/pointers would be appreciated..

thanks

-bruce

--
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] textarea/display question...

2004-07-20 Thread Vail, Warren
That is a tough question to answer simply, but the basic answer is yes.

What appears in the IFRAME is actually another web page, complete with it's
own set of controls and it's own form, and something to trigger the
submission of that form (separately from the page containing the IFRAME).
Suppose your entire form consisted of a collection of text controls (one for
each cell in your table);

Assume you have your data in a 2 dimension array $darray.  To display the
array on a page;

Echo table;
For($row = 0; $row  $height; $row++) {
echo tr;
for($col = 0; $col  $width; $col++) {
  echo tdinput type=text name=\farray[.$row.][.$col.]\ 
.value=\.$darray[$row][$col].\/td\n;
}
echo /tr;
}
Echo /table;

This would look much like a VB grid control, notice that a table by itself
is not an input type control.  This is just one solution, and so many are
available.  Notice that the form will return a multi-dimension array;

$returnarray = $_GET[farray];

Hope this gets you started.

Warren Vail


-Original Message-
From: bruce [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 20, 2004 11:51 AM
To: Vail, Warren; [EMAIL PROTECTED]
Subject: RE: [PHP] textarea/display question...


vail...

with an iframe... can i allow the user to make changes... and then capture
the data as a value for a post within a form..???

in other words...does it closely give me what a textarea does with regards
to allowing a user to make mods to the information?

-thanks..

ps.. to you guys who said that the textarea doesn't have a value=''.. it
does...



-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 11:20 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] textarea/display question...


Have you considered an imbedded frame?  (Looks like a textarea, with the
ability to imbed all types of controls (and tables) within it).  I'm not
sure that all browsers support IFRAME yet, but the most widely used one
does.

Another approach would be to use sprinf() formatting to imbed
leading/trailing spaces to allow everything to line up, assuming your text
area uses a fixed pitch font like courier.  Course since the control is an
input control, trust your users are going to screw up the alignment, and
don't count on getting the data back all neatly lined up.

Warren Vail


-Original Message-
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 10:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] textarea/display question...


hi..

i'm presenting a textarea to the user...

i'd like to be able to display the information within the textarea in a
table format. this would allow me to highlight the material that the user
should modify. however, i can't figure out how to accomplish this...

$foo = 'tabletrtd class='red'blah/td/tr/table';
textarea value='$foo'/textarea

something like the above, but without displaying all the attrib stuff...

any ideas/pointers would be appreciated..

thanks

-bruce

--
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: Putting $_POST into string to send to ASP

2004-07-16 Thread Vail, Warren
How about (probably one of fifty solutions;

Foreach($_POST as $k = $v) $vals[] = $k.=.$v;
$strvals = urlencode(implode(,$vals));
Header(Location: https://example.com/script.asp?.$strvals);

One thing to think about, URL's are limited in length, and one reason for
using method=post is that they won't fit in a URL, for this you'll need to
make sure they fit.

Warren Vail


-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 16, 2004 12:32 PM
To: Jeff Oien
Cc: PHP
Subject: [PHP] Re: Putting $_POST into string to send to ASP


Jeff Oien wrote:

 Dumb question, sorry if it's a repeat. I will use PHP for a form with
 error checking. When there are no errors I need to send all the 
 variables thru something like this:
 
 $URL = https://example.com/script.asp?First=JimLast=Smith;;
 urlencode($URL);
 header(Location: $URL\n);
 
 How do I gather up all the variables in $_POST and attach them as a
 string after the question mark? Thanks.
 Jeff

Try the http_build_query() function. If you don't have PHP 5, look in the
user notes--someone appears to have written one for PHP 4 as well (the user
note 21-Jun-2004 from 'brooklynphil'). I haven't tested either one.

   http://www.php.net/manual/en/function.http-build-query.php

Using this, you could just do something like:

   $query_string = http_build_query($_POST);


Hope this helps,

Torben [EMAIL PROTECTED]

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

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



RE: [PHP] Re: Putting $_POST into string to send to ASP

2004-07-16 Thread Vail, Warren
 You could do that, but for one thing, it doesn't handle 
 arrays. The code snippet in the user notes does.

You are absolutely correct, but I'm not sure that ASP could handle arrays
either.

On the other side Matt M.s processing should work better than mine;

foreach($_POST as $key = $value) {
   $arr[] = $key.'='.urlencode($value);
}

I believe my loop may change the  character to something it shouldn't?


Warren Vail


 -Original Message-
 From: Lars Torben Wilson [mailto:[EMAIL PROTECTED] 
 Sent: Friday, July 16, 2004 12:55 PM
 To: Vail, Warren
 Cc: 'Lars Torben Wilson'; Jeff Oien; PHP
 Subject: Re: [PHP] Re: Putting $_POST into string to send to ASP
 
 
 Vail, Warren wrote:
 
  How about (probably one of fifty solutions;
  
  Foreach($_POST as $k = $v) $vals[] = $k.=.$v;
  $strvals = urlencode(implode(,$vals));
  Header(Location: https://example.com/script.asp?.$strvals);
  
  One thing to think about, URL's are limited in length, and 
 one reason 
  for using method=post is that they won't fit in a URL, for 
 this you'll 
  need to make sure they fit.
  
  Warren Vail
 
 You could do that, but for one thing, it doesn't handle 
 arrays. The code snippet in the user notes does.
 
 
 
 -- 
 Torben Wilson [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP] Re: Putting $_POST into string to send to ASP

2004-07-16 Thread Vail, Warren
If the hack works, it should get around the length limitation of the URL,
but I would be more tempted to use CURL for that.

http://www.php.net/manual/en/ref.curl.php

Warren Vail

Warren Vail
(415) 667-0240
SF211-07-434
 


-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 16, 2004 1:12 PM
To: PHP
Subject: Re: [PHP] Re: Putting $_POST into string to send to ASP


Thanks for the helpful examples. One other question. Is there an 
advantage to sending the URL via a header as opposed to doing http_post 
like this?
http://shiflett.org/hacks/php/http_post
Jeff

-- 
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: Putting $_POST into string to send to ASP

2004-07-16 Thread Vail, Warren
I believe we all missed something important here, but I've been wrong
before.

Notice his URL below, specifically the https part.

I believe this means that the data not only needs to be URL encoded but SSL
encrypted.  I believe this makes a stronger case for using CURL, does it
not?  I also would mean that his hack code would not work.

Correct me if I'm wrong?

Warren Vail


-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 16, 2004 12:32 PM
To: Jeff Oien
Cc: PHP
Subject: [PHP] Re: Putting $_POST into string to send to ASP


Jeff Oien wrote:

 Dumb question, sorry if it's a repeat. I will use PHP for a form with
 error checking. When there are no errors I need to send all the 
 variables thru something like this:
 
 $URL = https://example.com/script.asp?First=JimLast=Smith;;
 urlencode($URL);
 header(Location: $URL\n);
 
 How do I gather up all the variables in $_POST and attach them as a
 string after the question mark? Thanks.
 Jeff

Try the http_build_query() function. If you don't have PHP 5, look in the
user notes--someone appears to have written one for PHP 4 as well (the user
note 21-Jun-2004 from 'brooklynphil'). I haven't tested either one.

   http://www.php.net/manual/en/function.http-build-query.php

Using this, you could just do something like:

   $query_string = http_build_query($_POST);


Hope this helps,

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



  1   2   3   >