[PHP] Re: Form Name Attribute Help!

2001-11-10 Thread jimw

Kal Amry [EMAIL PROTECTED] wrote:
 If I have a form in  named formName1 such as:
 
 form name=formName1 action=file.php method=post
 
 How can I get the name formName1 from within file.php

you can't. but you can add a hidden form field to each form to pass
along a value. for example:

form name=formName1 action=file.php method=post
input type=hidden name=form value=1 /
...
/form

(then you can just access $form in file.php to figure out which form was
submitted.)

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Windows/UNIX differences?

2001-11-02 Thread jimw

Ben Edwards [EMAIL PROTECTED] wrote:
 Have a regular expression which replaces ' with '' (used to insert ' into db):
   preg_replace(/\'/, '', $text );
 This works great on the UNIX production machine but not on windows 
 development environment.  Actually replaces ' with \'' not ''.
 
 Before I write a function that loops thought the whole thing looking at 
 each character and replaces ' with '' has anybody got any ideas?

rather than preg_replace behaving differently on windows and unix, it
seems more likely that your windows install of php has
'magic_quotes_gpc' set on in php.ini, and the unix install has it set to
off.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP slash Apache question?

2001-10-02 Thread jimw

Michael Champagne [EMAIL PROTECTED] wrote:
 Ok, this is semi-related to PHP.  I think it may mainly be our Apache
 configuration.  We have our listener listening on .
 
 This URL works: http://hostname.capis.com:/
 This URL does not: hostname.capis.com:/
 
 Is there anyway to get the bottom one to work?

not without the source to internet explorer. it is a shortcoming of
their url parsing (it mistakes the latter format for scheme:host
instead of host:port).

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: PHP slash Apache question?

2001-10-02 Thread jimw

Michael Champagne [EMAIL PROTECTED] wrote:
 Great, thanks for the response Jim.  Would there possibly be a way around this
 using mod_rewrite?

no. if you'll check your logs, you'll see that the request is never
even making it to your server. internet explorer simply barfs on urls
that include a port but don't include a scheme.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: GPL and The PHP License

2001-09-24 Thread jimw

Fábio migliorini [EMAIL PROTECTED] wrote:
 2) Can I write a program in php and to distribute it under the gpl license? 

yes.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Math Inside Strings

2001-08-29 Thread jimw

Kevin P [EMAIL PROTECTED] wrote:
 echo input type='hidden' name='currentPosition'
 value='$currentPosition+1';
 
 can anyone tell me how to get this to stop printing:
 
 input type='hidden' name='currentPosition' value='0+1'

echo input type='hidden' name='currentPosition' value=',
 $currentPosition+1,
 ';

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Eregi for Image

2001-08-26 Thread jimw

Jeff Oien [EMAIL PROTECTED] wrote:
 I want to check if an uploaded file is an image. This isn't working. 
 Could anyone  help me out?
 
 if (!eregi(\\.gif$, $img1_name) || 
 !eregi(\\.jpg$, $img1_name) || 
 !eregi(\\.jpeg$, $img1_name)) {
error message
 }

unless you expect the file to have three extensions at once, you
probably mean  for each of the places you wrote ||.

or you could do this:

  if (!ereg(\\.(gif|jpe?g)$, $img1_name)) {
error message
  }

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Stripping line break characters

2001-08-25 Thread jimw

Rory O'Connor [EMAIL PROTECTED] wrote:
 $sql2=str_replace(,\n,$sql2);
 $sql2=str_replace(,\r,$sql2);   

you've got the first two arguments backwards.

  $sql2=str_replace(\n,,$sql2);
  $sql2=str_replace(\r,,$sql2);   

or with php4.0.5 (or later):

  $sql2=str_replace(array(\n,\r),,$sql2);

for more details:

  http://www.php.net/manual/en/function.str-replace.php

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Newbie Question re: Select boxes

2001-08-23 Thread jimw

Lb [EMAIL PROTECTED] wrote:
 1) I thought that PHP automatically created variables for all form elements
 on a page. When I run this, the dropdown box contains the first item, but
 $Report evaluates as null. I am unclear why.
 
 select name=ReportBR
 option value=1 Test Report A/option
 option value=2 Test Report B/option
 option value=3 Test Report C/option
 /select
 ? echo (the value is $Report); ?

you have set the value for each option to an empty string. you
probably mean either 'option value=1Test Report A/option' or
'option1 Test Report A/option'.

 2) Is there any way for PHP to detect the change even on the dropdown, or do
 I need to use javascript?

you have to use javascript.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: order of update??

2001-08-23 Thread jimw

Gerard Samuel [EMAIL PROTECTED] wrote:
 My seem stupid to some, but when running
 update tablename set x='$x', y='$y', z='$z' where a=$a;
 Does it matter if it the set were in backwards order ie z, y, x ??

the order does not matter. (although unless you're sure $a is an
integer value, you may want to wrap it in quotes, too.)

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: print_r question

2001-08-23 Thread jimw

James [EMAIL PROTECTED] wrote:
 When I print an array out with print_r (php 4.06 on IIS 4.0) it does not
 print newlines even if newlines are embedded in the array element.  I must
 embed br, instead.

it probably is printing the newlines, but in html, newlines are
treated like any other whitespace, and do not always cause a new line.
you can wrap your output in pre/pre to preserve the newlines.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: hello and a question

2001-08-21 Thread jimw

Kevin Keeler [EMAIL PROTECTED] wrote:
 $entry_hidden = eregi_replace(hide.+/hide,hidden,$entry);

try: $entry_hidden = preg_replace(|hide.+?/hide|i,hidden,$entry);

.+ is 'greedy', meaning it consumes as much as text as it can. with
perl-like regular expressions, you can add a trailing ? which makes
the + and * operators non-greedy.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: virtual() ignoring str_replace()

2001-08-19 Thread jimw

Charlie Romero [EMAIL PROTECTED] wrote:
 $results = virtual(/cgi-bin/search.cgi?q=hellom=world);

virtual doesn't return the content of the subrequest, it sends it to
the browser.

you need to use something like popen() to do what you're trying
to do.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP Newsgroup?

2001-07-23 Thread jimw

Alexander Skwar [EMAIL PROTECTED] wrote:
 Is there a PHP newsgroup around?  I'm not talking about the ones at
 news.php.net, btw.
 
 Or is alt.php the official newsgroup?

the only thing resembling official newsgroups are those at
news.php.net.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Manual building/snapshot

2001-07-14 Thread jimw

Chris Lott [EMAIL PROTECTED] wrote:
 Since nothing seems to be available at snaps.php.net/manual I grabbed the
 phpdoc cvs tree. Could anyone who is building their own manual tell me what
 I need to build it? I'm running RedHat Linux 7.1

egon answered the question about what you need, but you may want to
keep in mind that the docs available at http://www.php.net/docs.php
are built every day (if there have been changes to that particular
translation) or weekly.

obviously, when the documentation is not in a buildable state, it is
not updated, which is why several of the translations have fallen
slightly behind.

jim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]