[PHP] mysql - xml

2002-11-26 Thread Snijders, Mark
hello,

For connection data between my site, and another site, I need to export my
MySql data to a XML file.

Does anybody know any excisting scripts for this? so I don't have to make it
all myself?

Thanks,

Mark Snijders




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




Re: [PHP] mysql - xml

2002-11-26 Thread @ Edwin
Hello,

Snijders, Mark [EMAIL PROTECTED] wrote:

 hello,

 For connection data between my site, and another site, I need to export my
 MySql data to a XML file.

 Does anybody know any excisting scripts for this? so I don't have to make
it
 all myself?

Have you checked the latest version of phpMyAdmin? You can export to
XML--check how it works :)

- E


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




Re: [PHP] Re: Sorting parsed XML

2002-11-26 Thread @ Edwin

Geoff Hankerson [EMAIL PROTECTED] wrote:

 This seems to me to be more easily handled by XSLT. (Not the only option 
 but a good one).
 XSLT lets you select only the nodes you want and also sort them as well.

Perhaps... but not all browsers support it.

Anyway, you can also select the nodes in PHP and you can sort them as well.

And you can do more than that... ;)

- E


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




Re: [PHP] Re: More mail() questions.

2002-11-26 Thread Beauford.2002
Thanks for the reply, however, that will not work.  The only line breaks you
may get with that are those layed out in a text box or from your mail
client. What if I have other variables that need to be put in the body of
the email.

i.e.

Age: 16
Height: 168
Weight: 120
etc
etc
etc.

These are variables that the user inputs into a form and need to be on a
seperate line, so if I did $message = $age, $weight, $height, etc. they
would appear on the same line - I need to have them on separate lines.

- Original Message -
From: Kyle Gibson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 25, 2002 10:54 PM
Subject: [PHP] Re: More mail() questions.


  I am  trying to get the message portion of the email to have line
breaks,
  but  whatever I do it displays on one line. This is what I have.
 
  $message = 1st Line\n;
  $message .= 2nd Line\n;
  $message .= \n;
  $message .= 3rd Line\n;
  $message .= \n;
  $message .= 4th Line\n;
 
  mail (, $subject, $message, $headers);
 
  TIA


 As far as I've encountered, you can simply do the following:

 ?

 $message = 
 This is the message I
 wish to send with linebreaks...



 all the way down here.
 ;


 mail (, $subject, $message, $headers);

 ?



 --
 Kyle Gibson
 admin(at)frozenonline.com
 http://www.frozenonline.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] Re: More mail() questions.

2002-11-26 Thread Ewout de Boer
Try '\r\n' instead of '\n'



regards,

Ewout de Boer

- Original Message -
From: Beauford.2002 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Kyle Gibson [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 10:17 AM
Subject: Re: [PHP] Re: More mail() questions.


 Thanks for the reply, however, that will not work.  The only line breaks
you
 may get with that are those layed out in a text box or from your mail
 client. What if I have other variables that need to be put in the body of
 the email.

 i.e.

 Age: 16
 Height: 168
 Weight: 120
 etc
 etc
 etc.

 These are variables that the user inputs into a form and need to be on a
 seperate line, so if I did $message = $age, $weight, $height, etc. they
 would appear on the same line - I need to have them on separate lines.

 - Original Message -
 From: Kyle Gibson [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 25, 2002 10:54 PM
 Subject: [PHP] Re: More mail() questions.


   I am  trying to get the message portion of the email to have line
 breaks,
   but  whatever I do it displays on one line. This is what I have.
  
   $message = 1st Line\n;
   $message .= 2nd Line\n;
   $message .= \n;
   $message .= 3rd Line\n;
   $message .= \n;
   $message .= 4th Line\n;
  
   mail (, $subject, $message, $headers);
  
   TIA
 
 
  As far as I've encountered, you can simply do the following:
 
  ?
 
  $message = 
  This is the message I
  wish to send with linebreaks...
 
 
 
  all the way down here.
  ;
 
 
  mail (, $subject, $message, $headers);
 
  ?
 
 
 
  --
  Kyle Gibson
  admin(at)frozenonline.com
  http://www.frozenonline.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] amp; in Query String

2002-11-26 Thread Marek Kilimajer
Get mailed also $_SERVER['HTTP_USER_AGENT'], I would like to see which 
browser does that.
amp; should get translated to , but not vice versa

Jonathan Rosenberg wrote:

I have a page with thumbnail pictures that can be clicked on to see a larger
picture.  Each picture is hyperlinked as follows

	a HREF=show_pic.php?pic=blahcaption=Some+Text

I access the 'pic'  'caption' attributes with $_GET['pic'], etc.  Pretty
standard stuff.

I have PHP set up so that error messages get mailed to a specified mail
account.  Every so often I get the following error message:

	Undefined index:  caption
	In file /home//show_pic.php, line 64
	page: /show_pic.php?pic=gb3.jpgamp;caption=Some+Text

The problem is obviously (I think) that the $_GET['caption'] is failing.

What I can't figure out is why the '' got turned into 'amp;'.  Is a
browser doing this?

--
Jonathan Rosenberg
Tabby (RB), Lynx (RB), Licorice, Tigger,
   Jet, Belle
http://www.tabbysplace.org/



 



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




Re: [PHP] Re: More mail() questions.

2002-11-26 Thread Beauford.2002
Tried that, but no go. I did figure it out however. Putting the following at
the bottom of the $header seemed to work.

$headers .= --=MIME_BOUNDRY_message_parts\n;
$headers .= Content-Type: text/plain; charset=\iso-8859-1\\n;
$headers .= Content-Transfer-Encoding: quoted-printable\n;


- Original Message -
From: Ewout de Boer [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 4:23 AM
Subject: Re: [PHP] Re: More mail() questions.


 Try '\r\n' instead of '\n'



 regards,

 Ewout de Boer

 - Original Message -
 From: Beauford.2002 [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; Kyle Gibson [EMAIL PROTECTED]
 Sent: Tuesday, November 26, 2002 10:17 AM
 Subject: Re: [PHP] Re: More mail() questions.


  Thanks for the reply, however, that will not work.  The only line breaks
 you
  may get with that are those layed out in a text box or from your mail
  client. What if I have other variables that need to be put in the body
of
  the email.
 
  i.e.
 
  Age: 16
  Height: 168
  Weight: 120
  etc
  etc
  etc.
 
  These are variables that the user inputs into a form and need to be on a
  seperate line, so if I did $message = $age, $weight, $height, etc.
they
  would appear on the same line - I need to have them on separate lines.
 
  - Original Message -
  From: Kyle Gibson [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 25, 2002 10:54 PM
  Subject: [PHP] Re: More mail() questions.
 
 
I am  trying to get the message portion of the email to have line
  breaks,
but  whatever I do it displays on one line. This is what I have.
   
$message = 1st Line\n;
$message .= 2nd Line\n;
$message .= \n;
$message .= 3rd Line\n;
$message .= \n;
$message .= 4th Line\n;
   
mail (, $subject, $message, $headers);
   
TIA
  
  
   As far as I've encountered, you can simply do the following:
  
   ?
  
   $message = 
   This is the message I
   wish to send with linebreaks...
  
  
  
   all the way down here.
   ;
  
  
   mail (, $subject, $message, $headers);
  
   ?
  
  
  
   --
   Kyle Gibson
   admin(at)frozenonline.com
   http://www.frozenonline.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





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




[PHP] Re: Making verification code harder to OCR?

2002-11-26 Thread Steve Edberg
There was a thread about something similar to this on Slashdot oh, at 
least a year ago. One technique that was suggested was to draw a 
random image on the screen - say, a grid of colored squares, or a set 
of different shapes/images - and just direct people to 'pick the blue 
square' or 'click on the large house' or something to finish the 
registration.

Of course, there are limits here for the color blind or those using 
text browsers/screen readers...

As an alternative, if you needed to stick with text fonts, you could 
use some unusual-looking ones, like old english, or a 3-d looking 
one, perhaps combined with the color technique below.

	-steve


At 8:09 AM +0100 11/26/02,  Derick Rethans [EMAIL PROTECTED] wrote:
Leif K-Brooks wrote:

I'm using a verification code image to stop automated sign ups, but 
two hackers seem to be OCRing it.  I've looked through the 
registration script, and there's definitley no security holes. 
Does anyone have any ideas as to making the image harder to OCR?

Use two different shades of one color (ie. blue and somewhat lighter 
blue). You may also want to do some tricks with the form of the 
characters, so instead having a nice 0 on your screen, you can use 
dots to somewhat represent it. (Much like the color-blindness tests 
do).

regards,
Derick


?php
// seed with microseconds
function make_seed() {
   list($usec, $sec) = explode(' ', microtime());
   return (float) $sec + ((float) $usec * 10);
}
$seed = make_seed();
mt_srand($seed);
$dbh = mysql_connect (, , ) or exit;
mysql_select_db (,$dbh) or exit;
$authimage = ImageCreate(40,15);
$bgnum = mt_rand(1,3);
switch($bgnum){
case 1:
$white = ImageColorAllocate($authimage, mt_rand(250,255), 
mt_rand(250,255), mt_rand(250,255));
break;
case 2:
$green = ImageColorAllocate($authimage, mt_rand(0,5), 
mt_rand(250,255), mt_rand(0,5));
break;
case 3:
$yellow = ImageColorAllocate($authimage, mt_rand(250,255), 
mt_rand(250,255), mt_rand(0,5));
break;
}
$black = ImageColorAllocate($authimage, mt_rand(0,30), 0, 0);
header(Content-type: image/png);
$getcode = mysql_fetch_array(mysql_query(select * from signupcodes 
where id = '$id'));
imagestring($authimage,mt_rand(4,5),mt_rand(0,5),0,$getcode['code'],$black);
imageline($authimage,0,mt_rand(0,15),40,mt_rand(0,15),$black);
imageline($authimage,0,mt_rand(0,15),40,mt_rand(0,15),$black);
imagepng($authimage);
imagedestroy($authimage);
?




--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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



--
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| SETI@Home: 1001 Work units on 23 oct 2002  |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
++

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




[PHP] executing a command in different prompt through PHP

2002-11-26 Thread Sanjoy Kumar Roy
hi,
i want to know how to execute a command of another program in PHP. For 
example, i run a server program and get a command prompt from that server 
program. Now i want to execute a command of that server program in that 
command prompt from a web interface that is going to be designed in PHP. i 
want to know how to do that in PHP.
hope someone can help me out..
bye
sanjoy

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



Re: [PHP] array manipulations

2002-11-26 Thread Marek Kilimajer
if all you might have there is 'error', try
if(array_search('error',$array) === FALSE) {
   echo 'not ok';
}

if you might have different strings, do
$result='ok';
foreach($array as $v) {
   if($v) {
   $result ='not ok';
   break;
   }
}

Mattia wrote:


Can anyone suggest an ELEGANT way to find out if an array is made of empty
strings or not?

example

$a = Array( '' , '' , '' ); //ok
$b = Array( '' , '' , 'error' ); // not ok
$c = Array( 'error' , '' , 'error' ); // not ok

tia
Mattia



 



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




[PHP] session.save_path = /dev/shm

2002-11-26 Thread Jacob Larsen
When I use  session.save_handler = mm  I can only make it work by setting
session.save_path = /dev/shm
Is that how it should be?


Regards, Jacob
www.sharksforum.com



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




[PHP] Re: Missing images

2002-11-26 Thread Martin Johansson
I had this problem when I stored my images on another webserver, and linked
the images with the whole adress like img src=http://somewhere/image.gif;
I solved the problem by copying the images to the same webserver that views
the
page.
The last webserver was to slow to replay that it had the pictures. Maybe
this is the
problem you have?
/Martin

 Hi all

 I have kind of a very strange problem... But I hope someone can help.
 Imageing a little web-based application for browsing images. Every page is
 exactly the same (from a php point of view). A user can browse through all
 the images which are displayed as thumbnails. Normally, everything works
 fine...

 But on some browsers (and or operating systems), suddenly, at a certain
 point, all images are turning white. No more new images are shown. Old
 images (which have already been shown earlier) are fine, but no new ones.
 They are just white. Reloading the page or reentering the URL doesn't
work.
 The only thing which does work is shutting down the browser and restarting
 the whole thing.

 So, why do some images turn white? These normally happens after about the
 6th page of images (12 iamges a page). Any idea?

 Thanks a lot
 reto





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




[PHP] Re: session.save_path = /dev/shm

2002-11-26 Thread Jacob Larsen
sorry, the solution was not to use session.save_path=/dev/shm, but to
install a new version of mm.

Regards, Jacob
www.sharksforum.com

 When I use  session.save_handler = mm  I can only make it work by setting
 session.save_path = /dev/shm
 Is that how it should be?



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




[PHP] calling a php function

2002-11-26 Thread Adrian Partenie
Hello,

Can I call a php function using forms in the same way as I do for a javascript 
function? (in the same page, not with php_self).

?php


function()
{...
}
?




form method=post action=function()
.

/form

Thanks, Adrian


Re: [PHP] calling a php function

2002-11-26 Thread John Nichel
No, you can't.  PHP is run on the server side.  JavaScript is client side.

Adrian Partenie wrote:

Hello,

Can I call a php function using forms in the same way as I do for a javascript function? (in the same page, not with php_self).

?php


function()
{...
}
?




form method=post action=function()
.

/form

Thanks, Adrian



--
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] store images in mysql tables

2002-11-26 Thread Vivek Kedia
can i store images in mysql table using php , is it
possible if yes then pl show me where i can read more
about it



[EMAIL PROTECTED]



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] store images in mysql tables

2002-11-26 Thread Justin French
Please do a quick google search first:

http://www.google.com/search?hl=enie=ISO-8859-1q=storing+images+in+mysqlb
tnG=Google+Search

Or at least TRY to find the answer by yourself.


on 26/11/02 11:42 PM, Vivek Kedia ([EMAIL PROTECTED]) wrote:

 can i store images in mysql table using php , is it
 possible if yes then pl show me where i can read more
 about it


Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




[PHP] If statement w/ multiple conditions

2002-11-26 Thread ed

 I'll be trying to use a routine that checks 4 seperate variables for
content and need to know the easiest method to do so. The function works
on 2 conditions; either all the variables are empty and I do something or
I do something else.

$lineone
$linetwo
$linethree
$linefour

 Would you use 

if ($lineone  $linetwo  $linethree  $linefour = )

Thanks,

Ed



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




Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Ernest E Vogelsinger
At 13:50 26.11.2002, [EMAIL PROTECTED] said:
[snip]
 I'll be trying to use a routine that checks 4 seperate variables for
content and need to know the easiest method to do so. The function works
on 2 conditions; either all the variables are empty and I do something or
I do something else.

$lineone
$linetwo
$linethree
$linefour

 Would you use 

if ($lineone  $linetwo  $linethree  $linefour = )
[snip] 

Your expression yields true if 1-3 are not-empty AND four is an empty
string. Not sure if that's what you want.

All empty:
!($lineone || $linetwo || $linethree || $linefour)
--or--
!$lineone  !$linetwo  !$linethree  !$linefour

All set:
$lineone  $linetwo  $linethree  $linefour


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Automajickally POST to a remote form

2002-11-26 Thread Kris Williams


You can post with PHP using cURL or doing it yourself manually.
Search the archives for this, as the previous answers to this are
more complete than what I have time to explain now. Here is a quick
example of the manual approach:

http://shiflett.org/tutorials/php_post.txt


Thanks Chris.  A useful answer that's much appreciated :)

And yeh, after just after posting I realised my example using Google was a 
bad one with of the GET/POST thing.  Just tried to pick a generic site as 
an example as what I'm intending to do is probably too much hassle to 
explain in full.


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



Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread ed

 All four must be an empty string. I will be pulling the values from a
MySQL database. If these fields are empty I'll be prompting for
information. If any one of them contain anything I'll be showing it to
the user and asking if they want to change it.

Thanks,

Ed


On Tue, 26 Nov 2002, Ernest E Vogelsinger wrote:

 At 13:50 26.11.2002, [EMAIL PROTECTED] said:
 [snip]
  I'll be trying to use a routine that checks 4 seperate variables for
 content and need to know the easiest method to do so. The function works
 on 2 conditions; either all the variables are empty and I do something or
 I do something else.
 
 $lineone
 $linetwo
 $linethree
 $linefour
 
  Would you use 
 
 if ($lineone  $linetwo  $linethree  $linefour = )
 [snip] 
 
 Your expression yields true if 1-3 are not-empty AND four is an empty
 string. Not sure if that's what you want.
 
 All empty:
 !($lineone || $linetwo || $linethree || $linefour)
 --or--
 !$lineone  !$linetwo  !$linethree  !$linefour
 
 All set:
 $lineone  $linetwo  $linethree  $linefour
 
 
 -- 
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/
 
 
 
 -- 
 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] store images in mysql tables

2002-11-26 Thread Martin Johansson
Yes you can store images in a mysql table. But you will have to create a new
binary database.

You can read here how it works:
http://www.phpbuilder.com/columns/florian19991014.php3
It is a easy to understand text.
/Martin



Justin French [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Please do a quick google search first:


http://www.google.com/search?hl=enie=ISO-8859-1q=storing+images+in+mysqlb
 tnG=Google+Search

 Or at least TRY to find the answer by yourself.


 on 26/11/02 11:42 PM, Vivek Kedia ([EMAIL PROTECTED]) wrote:

  can i store images in mysql table using php , is it
  possible if yes then pl show me where i can read more
  about it


 Justin French
 
 http://Indent.com.au
 Web Development 
 Graphic Design
 




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




[PHP] IIS and PHP with $HTTP_SERVER_VARS

2002-11-26 Thread Shaun Garriock
Hi
The problem I am having is as follows:
I setup PHP with IIS and it seems to work fine. I am creating a Intranet
site and would like to obtain the user logged on to the networks
username. I have setup basic auth but when I visit the site it asks me
for my username and password before I can get in. Integrated Windows
Auth is turned off. When I turn it on and try to login it says login
failed. I know that ASP can have a script added to the page to turn pass
through auth but I need one for PHP.
I am using $HTTP_SERVER_VARS[LOGON_USER] to get the username and it
works when I login. I just need to get rid of the login box.

Thanks for your help in advance.

Shaun Garriock


*** The contents of this message are confidential and are intended for the addressee 
only. The views expressed in this message do not necessarily represent those of Robert 
Gordon's College. Electronic mail transmission is not guaranteed to be secure, 
therefore, Robert Gordon's College does not accept liability for the contents of this 
transmission. This message does not form a legal binding contract. ***


Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread DL Neil
Ed,
Assuming there will be a response from the db-tbl, here is another choice:

if ( $lineone . $linetwo . $linethree . $linefour   )
{
   //show it to the user and ask if they want to change it
}
else
{
   //prompt for information
}

Do you mean that the db-tbl will have a row of data even if the four fields
are empty, or if there is no data (in those fields) will that imply that
there is no row (and thus different code needed)?
=dn


  All four must be an empty string. I will be pulling the values from a
 MySQL database. If these fields are empty I'll be prompting for
 information. If any one of them contain anything I'll be showing it to
 the user and asking if they want to change it.

 Thanks,

 Ed


 On Tue, 26 Nov 2002, Ernest E Vogelsinger wrote:

  At 13:50 26.11.2002, [EMAIL PROTECTED] said:
  [snip]
   I'll be trying to use a routine that checks 4 seperate variables for
  content and need to know the easiest method to do so. The function
works
  on 2 conditions; either all the variables are empty and I do something
or
  I do something else.
  
  $lineone
  $linetwo
  $linethree
  $linefour
  
   Would you use
  
  if ($lineone  $linetwo  $linethree  $linefour = )
  [snip]
 
  Your expression yields true if 1-3 are not-empty AND four is an empty
  string. Not sure if that's what you want.
 
  All empty:
  !($lineone || $linetwo || $linethree || $linefour)
  --or--
  !$lineone  !$linetwo  !$linethree  !$linefour
 
  All set:
  $lineone  $linetwo  $linethree  $linefour
 
 
  --
 O Ernest E. Vogelsinger
 (\)ICQ #13394035
  ^ http://www.vogelsinger.at/
 
 
 
  --
  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] If statement w/ multiple conditions

2002-11-26 Thread ed

 The db will include these 4 rows even though they don't store data.
Eventually they will contain data for contact info as soon as the users
log in and it prompts them for it.

On Tue, 26 Nov 2002, DL Neil wrote:

 Ed,
 Assuming there will be a response from the db-tbl, here is another choice:
 
 if ( $lineone . $linetwo . $linethree . $linefour   )
 {
//show it to the user and ask if they want to change it
 }
 else
 {
//prompt for information
 }
 
 Do you mean that the db-tbl will have a row of data even if the four fields
 are empty, or if there is no data (in those fields) will that imply that
 there is no row (and thus different code needed)?
 =dn
 
 
   All four must be an empty string. I will be pulling the values from a
  MySQL database. If these fields are empty I'll be prompting for
  information. If any one of them contain anything I'll be showing it to
  the user and asking if they want to change it.
 
  Thanks,
 
  Ed
 
 
  On Tue, 26 Nov 2002, Ernest E Vogelsinger wrote:
 
   At 13:50 26.11.2002, [EMAIL PROTECTED] said:
   [snip]
I'll be trying to use a routine that checks 4 seperate variables for
   content and need to know the easiest method to do so. The function
 works
   on 2 conditions; either all the variables are empty and I do something
 or
   I do something else.
   
   $lineone
   $linetwo
   $linethree
   $linefour
   
Would you use
   
   if ($lineone  $linetwo  $linethree  $linefour = )
   [snip]
  
   Your expression yields true if 1-3 are not-empty AND four is an empty
   string. Not sure if that's what you want.
  
   All empty:
   !($lineone || $linetwo || $linethree || $linefour)
   --or--
   !$lineone  !$linetwo  !$linethree  !$linefour
  
   All set:
   $lineone  $linetwo  $linethree  $linefour
  
  
   --
  O Ernest E. Vogelsinger
  (\)ICQ #13394035
   ^ http://www.vogelsinger.at/
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


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




[PHP] passing complete URL through php scripts using javascript popup

2002-11-26 Thread Nicole Lallande
Gretings:

I am trying to set up a referal  script; I want to pass a URL query 
string to another php script.  I am able to pass the complete query 
string with all the variables I want through to the javascript function 
call but then the string gets cut in the php script:

in the shopping cart:
a href=javascript: openWin('email.php?ref=?php echo $pageURL; 
?')this page/a

where 'ref' is set correctly and  $pageURL is returned as 
'http://mydomain.com/shop.php?val1=1val2=2val3=3' (this shows up on my 
status bar and I can 'echo' it on the shopping cart page - so Iknow it 
is getting captured correctly -- also - I removed the javascript and saw 
it get passet in the url as a 'get' correctly.)

but in the email script in the popup window I try to display 'ref' and 
what I get is:

'http://mydomain.com/shop.php?val1=1' -- everything past the first '' 
gets cut off (ie, I lose  the 'val2=2val3=3' portion of the query string )

Any ideas?  Sorry if this is obvious - pulling an 'all nighter'...

TIA,

Nicole


--

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766




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



[PHP] DBX: eq to mysql_insert_id

2002-11-26 Thread Mirek Novak
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
	does anybody know how to obtain id of last inserted row via dbx ?
- --
- --
Mirek Novak
ICQ:119499448
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAj3jgGEACgkQz+tW1WzgrpSpzwCgtf/cyMHxiz6Op7I8Lxa2TDqD
ZH4AmQHBGYpMOaDshsw+b2284P72ADjQ
=Fh4D
-END PGP SIGNATURE-


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




Re: [PHP] Re: Sorting parsed XML

2002-11-26 Thread Geoff Hankerson
You don't need to do client-side transformation (although you could 
check user agent and do it client-side if the browser supports it).
You can use Php's XSLT functions see the manual for more info.

I was just suggesting this as a potential option. It may not be 
appropriate in this situation. I don't really know enough about the 
programming challenge we are looking at  to say for sure


@ Edwin wrote:

Geoff Hankerson [EMAIL PROTECTED] wrote:

 

This seems to me to be more easily handled by XSLT. (Not the only option 
but a good one).
XSLT lets you select only the nodes you want and also sort them as well.
   


Perhaps... but not all browsers support it.

Anyway, you can also select the nodes in PHP and you can sort them as well.

And you can do more than that... ;)

- E



 




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




[PHP] Re: If statement w/ multiple conditions

2002-11-26 Thread Craig
Something like this will work...

?php

 if(empty($_GET['1'])  empty($_GET['2'])  empty($_GET['3']) 
empty($_GET['4'])){

  echo All vars are EMPTY;

 }else{

  echo Some vars contain Content;

 }

?





[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  I'll be trying to use a routine that checks 4 seperate variables for
 content and need to know the easiest method to do so. The function works
 on 2 conditions; either all the variables are empty and I do something or
 I do something else.

 $lineone
 $linetwo
 $linethree
 $linefour

  Would you use

 if ($lineone  $linetwo  $linethree  $linefour = )

 Thanks,

 Ed





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




[PHP] base64_decode()

2002-11-26 Thread Cenk Uysal
hi,

i want to save a base64 encoded string after i decode it. i saw that
base64_decode function returns a string. so how do i save it as a binary
file? i plan to save it to postgresql database field.

thanks...



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




Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Craig
Something like this will work...

?php

 if(empty($_GET['1'])  empty($_GET['2'])  empty($_GET['3']) 
empty($_GET['4'])){

  echo All vars are EMPTY;

 }else{

  echo Some vars contain Content;

 }

?

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  The db will include these 4 rows even though they don't store data.
 Eventually they will contain data for contact info as soon as the users
 log in and it prompts them for it.

 On Tue, 26 Nov 2002, DL Neil wrote:

  Ed,
  Assuming there will be a response from the db-tbl, here is another
choice:
 
  if ( $lineone . $linetwo . $linethree . $linefour   )
  {
 //show it to the user and ask if they want to change it
  }
  else
  {
 //prompt for information
  }
 
  Do you mean that the db-tbl will have a row of data even if the four
fields
  are empty, or if there is no data (in those fields) will that imply that
  there is no row (and thus different code needed)?
  =dn
 
 
All four must be an empty string. I will be pulling the values from a
   MySQL database. If these fields are empty I'll be prompting for
   information. If any one of them contain anything I'll be showing it to
   the user and asking if they want to change it.
  
   Thanks,
  
   Ed
  
  
   On Tue, 26 Nov 2002, Ernest E Vogelsinger wrote:
  
At 13:50 26.11.2002, [EMAIL PROTECTED] said:
[snip]
 I'll be trying to use a routine that checks 4 seperate variables
for
content and need to know the easiest method to do so. The function
  works
on 2 conditions; either all the variables are empty and I do
something
  or
I do something else.

$lineone
$linetwo
$linethree
$linefour

 Would you use

if ($lineone  $linetwo  $linethree  $linefour = )
[snip]
   
Your expression yields true if 1-3 are not-empty AND four is an
empty
string. Not sure if that's what you want.
   
All empty:
!($lineone || $linetwo || $linethree || $linefour)
--or--
!$lineone  !$linetwo  !$linethree  !$linefour
   
All set:
$lineone  $linetwo  $linethree  $linefour
   
   
--
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/
   
   
   
--
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: If statement w/ multiple conditions

2002-11-26 Thread ed

 That's what I was looking to acheive. Thanks!

Ed


On Tue, 26 Nov 2002, Craig wrote:

 Something like this will work...
 
 ?php
 
  if(empty($_GET['1'])  empty($_GET['2'])  empty($_GET['3']) 
 empty($_GET['4'])){
 
   echo All vars are EMPTY;
 
  }else{
 
   echo Some vars contain Content;
 
  }
 
 ?
 
 
 
 
 
 [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
   I'll be trying to use a routine that checks 4 seperate variables for
  content and need to know the easiest method to do so. The function works
  on 2 conditions; either all the variables are empty and I do something or
  I do something else.
 
  $lineone
  $linetwo
  $linethree
  $linefour
 
   Would you use
 
  if ($lineone  $linetwo  $linethree  $linefour = )
 
  Thanks,
 
  Ed
 
 
 
 
 
 -- 
 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] can't pass complete URL (part of the query string) from one scriptto another --??

2002-11-26 Thread Nicole Lallande
Gretings:

I want to pass a URL query string to another php script.  I am able to 
pass the complete query string with all the variables I want through to 
the javascript function call but then the string gets cut in the php 
script:

in the shopping cart:
a href=javascript: openWin('email.php?ref=?php echo $pageURL; 
?')this page/a

where 'ref' is set correctly and  $pageURL is returned as 
'http://mydomain.com/shop.php?val1=1val2=2val3=3' (this shows up on my 
status bar and I can 'echo' it on the shopping cart page - so Iknow it 
is getting captured correctly -- also - I removed the javascript and saw 
it get passet in the url as a 'get' correctly.)

but in the email script  I try to display 'ref' and what I get is:

'http://mydomain.com/shop.php?val1=1' -- everything past the first '' 
gets cut off (ie, I lose  the 'val2=2val3=3' portion of the query 
string )

Any ideas?  Sorry if this is obvious - pulling an 'all nighter'...

TIA,

Nicole

--

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766




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



Re: [PHP] Re: More mail() questions.

2002-11-26 Thread 1LT John W. Holmes
 Tried that, but no go. I did figure it out however. Putting the following
at
 the bottom of the $header seemed to work.

 $headers .= --=MIME_BOUNDRY_message_parts\n;
 $headers .= Content-Type: text/plain; charset=\iso-8859-1\\n;
 $headers .= Content-Transfer-Encoding: quoted-printable\n;

You should separate mail headers with \r\n instead of just \n.

---John Holmes...


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




Re: [PHP] Re: More mail() questions.

2002-11-26 Thread 1LT John W. Holmes
 Thanks for the reply, however, that will not work.  The only line breaks
you
 may get with that are those layed out in a text box or from your mail
 client. What if I have other variables that need to be put in the body of
 the email.

 i.e.

 Age: 16
 Height: 168
 Weight: 120
 etc
 etc
 etc.

 These are variables that the user inputs into a form and need to be on a
 seperate line, so if I did $message = $age, $weight, $height, etc. they
 would appear on the same line - I need to have them on separate lines.

So do this:

$message = 
Here is your email:

Age: $age
Height: $height
Weight: $weight
etc
etc
etc... ;

---John Holmes...


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




AW: [PHP] can't pass complete URL (part of the query string) from one script to another --??

2002-11-26 Thread Martin Lucas
hi nicole,

do you have an example what your query contains ?
maybe urlencode($pageURL) or quoting will help

greetings martin

 -Ursprüngliche Nachricht-
 Von: Nicole Lallande [mailto:[EMAIL PROTECTED]]
 Gesendet: Dienstag, 26. November 2002 15:40
 An: [EMAIL PROTECTED]
 Betreff: [PHP] can't pass complete URL (part of the query string) from
 one script to another --??
 
 
 Gretings:
 
 I want to pass a URL query string to another php script.  I 
 am able to 
 pass the complete query string with all the variables I want 
 through to 
 the javascript function call but then the string gets cut in the php 
 script:
 
 in the shopping cart:
 a href=javascript: openWin('email.php?ref=?php echo $pageURL; 
 ?')this page/a
 
 where 'ref' is set correctly and  $pageURL is returned as 
 'http://mydomain.com/shop.php?val1=1val2=2val3=3' (this 
 shows up on my 
 status bar and I can 'echo' it on the shopping cart page - so 
 Iknow it 
 is getting captured correctly -- also - I removed the 
 javascript and saw 
 it get passet in the url as a 'get' correctly.)
 
 but in the email script  I try to display 'ref' and what I get is:
 
 'http://mydomain.com/shop.php?val1=1' -- everything past the 
 first '' 
 gets cut off (ie, I lose  the 'val2=2val3=3' portion of the query 
 string )
 
 Any ideas?  Sorry if this is obvious - pulling an 'all nighter'...
 
 TIA,
 
 Nicole
 
 -- 
 
 Nicole Lallande
 [EMAIL PROTECTED]
 760.753.6766
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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




[PHP] Re: can't pass complete URL (part of the query string) from one script to another --??

2002-11-26 Thread Erwin
Nicole Lallande wrote:
 Gretings:

 I want to pass a URL query string to another php script.  I am able to
 pass the complete query string with all the variables I want through
 to the javascript function call but then the string gets cut in the
 php script:

 in the shopping cart:
 a href=javascript: openWin('email.php?ref=?php echo $pageURL;
 ')this page/a

 where 'ref' is set correctly and  $pageURL is returned as
 'http://mydomain.com/shop.php?val1=1val2=2val3=3' (this shows up on
 my status bar and I can 'echo' it on the shopping cart page - so
 Iknow it is getting captured correctly -- also - I removed the
 javascript and saw it get passet in the url as a 'get' correctly.)

 but in the email script  I try to display 'ref' and what I get is:

 'http://mydomain.com/shop.php?val1=1' -- everything past the first ''
 gets cut off (ie, I lose  the 'val2=2val3=3' portion of the query
 string )

Use

a href=javascript:
openWin('email.php?ref=?=urlencode($pageURL);?')this page/a

HTH
Erwin


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




[PHP] using mbstring without having /configure'd it

2002-11-26 Thread Oliver Spiesshofer
Hi,

Is it possible to use mbstring after setting the necessary values in 
ini_set() or htaccess without having it enabled during /configure?

thanks

Oliver

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




[PHP] Multiple page form

2002-11-26 Thread Shane McBride
Hi there.

It's been a while since I have done any PHP work. I am creating an online
employment application using multiple forms for a client. I was going to use
PHP. I don't remember if I need to pass variables along with the form for
each page, or can I just call them on the last page.

The application form is very long. Any ideas? There may be a script that
exists already?

Anyway, it's nice to be back.

- Shane



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




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
 It's been a while since I have done any PHP work. I am creating an online
 employment application using multiple forms for a client. I was going to use
 PHP. I don't remember if I need to pass variables along with the form for
 each page, or can I just call them on the last page.
 The application form is very long. Any ideas? There may be a script that
 exists already?

What I usually do for my multi-page form is INSERT the data to a table on
the first page then UPDATE that record on subsequent pages.  The only
thing I need to pass on is the primary key value for the record.

Chris


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




Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Chris Shiflett
--- Ernest E Vogelsinger [EMAIL PROTECTED] wrote:

 At 13:50 26.11.2002, [EMAIL PROTECTED] said:
 if ($lineone  $linetwo  $linethree  $linefour = )

 Your expression yields true if 1-3 are not-empty AND four is an
 empty string.

Actually, this expression yields true when $lineone, $linetwo, and
$linethree are all true. The variable $linefour is just being set to
the empty string.

Don't confuse boolean tests with tests for whether a string is empty.
Yes, an empty variable will evaluate as false, but so will a variable
containing 0 or set to false.

 All empty:
 !($lineone || $linetwo || $linethree || $linefour)
 --or--
 !$lineone  !$linetwo  !$linethree  !$linefour
 All set:
 $lineone  $linetwo  $linethree  $linefour

Same problem here. Try these conditionals with the following values:
$lineone = 0;
$linetwo = 0;
$linethree = 0;
$linefour = 0;

Something like this will probably work:

$all = $lineone . $linetwo . $linethree . $linefour;
if (empty($all))
{
 echo All lines are empty;
}
else
{
 echo All lines are not empty;
}

Chris

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




[PHP] Re: using mbstring without having /configure'd it

2002-11-26 Thread Erwin
Oliver Spiesshofer wrote:
 Hi,
 
 Is it possible to use mbstring after setting the necessary values in
 ini_set() or htaccess without having it enabled during /configure?

Nope...the functions of mb are unknown, because you didn't compile them.

Grtz Erwin

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




Re: [PHP] Re: Sorting parsed XML

2002-11-26 Thread @ Edwin

Geoff Hankerson [EMAIL PROTECTED] wrote:

 You don't need to do client-side transformation (although you could
 check user agent and do it client-side if the browser supports it).
 You can use Php's XSLT functions see the manual for more info.

 I was just suggesting this as a potential option. It may not be
 appropriate in this situation. I don't really know enough about the
 programming challenge we are looking at  to say for sure

I see. I thought you were saying that use XSLT and access the xml file
directly--my apologies.

Anyway, _that_ is certainly a potential option... :)

- E

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




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Shiflett
--- Shane McBride [EMAIL PROTECTED] wrote:

 I don't remember if I need to pass variables along with the
 form for each page, or can I just call them on the last page.

Consider using sessions:

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

Chris

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




RE: [PHP] Multiple page form

2002-11-26 Thread Shane McBride
So, you are using a database to store the records?

-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 10:45 AM
To: Shane McBride; [EMAIL PROTECTED]
Subject: Re: [PHP] Multiple page form


 It's been a while since I have done any PHP work. I am creating an online
 employment application using multiple forms for a client. I was going to
use
 PHP. I don't remember if I need to pass variables along with the form for
 each page, or can I just call them on the last page.
 The application form is very long. Any ideas? There may be a script that
 exists already?

What I usually do for my multi-page form is INSERT the data to a table on
the first page then UPDATE that record on subsequent pages.  The only
thing I need to pass on is the primary key value for the record.

Chris



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




[PHP] Re: amp; in Query String

2002-11-26 Thread Erwin
Derick Rethans wrote:
 Jonathan Rosenberg wrote:
 I have a page with thumbnail pictures that can be clicked on to see
 a larger picture.  Each picture is hyperlinked as follows

 a HREF=show_pic.php?pic=blahcaption=Some+Text

 I access the 'pic'  'caption' attributes with $_GET['pic'], etc.
 Pretty standard stuff.

 I have PHP set up so that error messages get mailed to a specified
 mail account.  Every so often I get the following error message:

 Undefined index:  caption
 In file /home//show_pic.php, line 64
 page: /show_pic.php?pic=gb3.jpgamp;caption=Some+Text

 The problem is obviously (I think) that the $_GET['caption'] is
 failing.

True, if you receive amp;caption in your URL, then the variable won't be
called $_GET['caption'], but $_GET['amp;caption'], which (I think) is
invalid because of the ;.


 What I can't figure out is why the '' got turned into 'amp;'.  Is a
 browser doing this?

 Yes it is.

No, it isn't. I sure hope there is no browser which turns  in amp; in
URL's. That would be very, very bad indeed!

 Actually, you should specify the URL with the amp;
 yourself, like this:

 a HREF=show_pic.php?pic=blahamp;caption=Some+Text

Of course not...this is a HREF tag, which can use  instead of amp;. amp;
is for displaying purposes only, not for URL's.

Following the tip from Marek, adjust your errormessage mailing thingy...add
all the $_GET variables to it (print_r($_GET)). Some other notices maybe
usefull to...

Erwin


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




[PHP] using declare .. ticks functionality

2002-11-26 Thread Simon Taylor
Hi All,
Quick question, has anyone had any luck using the 

register_tick_function 

and 

declare (ticks=32){ ...} 

construct?

I have a need to try this out to measure the times taken in various
functions etc using this sort of method, I want to know is there any way of
extracting the function name or some sort of useful information and passing
it to the registered tick function.
Thanks for any help
Cheers
_
Simon Taylor
AfriTol (Pty) Ltd.
[EMAIL PROTECTED]
 

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




Re: [PHP] using mbstring without having /configure'd it

2002-11-26 Thread @ Edwin
Hello,
(B
(B"Oliver Spiesshofer" [EMAIL PROTECTED] wrote:
(B
(B Hi,
(B
(B Is it possible to use mbstring after setting the necessary values in
(B ini_set() or htaccess without having it enabled during /configure?
(B
(BNo.
(B
(BWell, if you're using windoze, you can probably just do it in your php.ini
(Bbut it seems like you're not, so...
(B
(BAnyway,
(B
(B- E
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Jason Wong
On Tuesday 26 November 2002 23:45, Chris Shiflett wrote:
 --- Ernest E Vogelsinger [EMAIL PROTECTED] wrote:
  At 13:50 26.11.2002, [EMAIL PROTECTED] said:
  if ($lineone  $linetwo  $linethree  $linefour = )
 
  Your expression yields true if 1-3 are not-empty AND four is an
  empty string.

 Actually, this expression yields true when $lineone, $linetwo, and
 $linethree are all true. The variable $linefour is just being set to
 the empty string.

Actually that expression will always be FALSE. $linefour =  does not 
evaluate to TRUE thus the whole expression to be FALSE!

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

/*
Someone was smoking in the computer room and set off the halon systems.
*/


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




[PHP] Re: Starting an application on web server

2002-11-26 Thread Erwin
Nic Fordham wrote:
 Hi there,
 I am hosting a server running castle wolfenstein for a few friends of
 mine  want to make a web page to run on the same server that they
 can log in to to stop  start the game when they want.
 I have tried putting the following code in a web page -
 
 ?
 exec ('f:\wolf\wolfmp.exe +set dedicated 2 +map mp_beach  +set
 sv_maxclients 8 ')
 
 
 This creates a process on my server as of wolfmp.exe but I cannot see
 it on my lan  they can't see it over the web.

Probably it failed? Or is requesting some more information?

 I also don't get any visual output on the server of the wolfmp.exe
 starting up the game console.

Don't you get any visual output if you use passthru instead of exec???

Erwin

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




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
 So, you are using a database to store the records?

Yes.  What's the point in taking the user's information if you aren't
going to store it somewhere.  Even if all you need to do is email
the data upon completion of the form, storing the data for later use
would be a good idea.

Chris


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




RE: [PHP] Re: amp; in Query String

2002-11-26 Thread Jonathan Rosenberg \(Tabby's Place\)
In an earlier message,  Derick Rethans [mailto:[EMAIL PROTECTED]] said ...

 Yes it is. Actually, you should specify the URL with the
 amp; yourself, like this:

 a HREF=show_pic.php?pic=blahamp;caption=Some+Text

 otherwise it is not valid HTML.

I understand that using '' is technically not correct HTML.  But I don't
see how changing the '' - 'amp;' solves my problem.

But just to be sure I tried it.  Sure enough, this caused the error to
occur.

I'm missing something here.  If you use 'amp;' to separate arguments on the
query string, how do they get separated out for access via $_GET?

 --

--
JR



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




Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Chris Shiflett
--- Jason Wong [EMAIL PROTECTED] wrote:

 At 13:50 26.11.2002, [EMAIL PROTECTED] said:
 if ($lineone  $linetwo  $linethree  $linefour = )

 Actually that expression will always be FALSE. $linefour = 
 does not evaluate to TRUE thus the whole expression to be FALSE!

Yes, you're right. Of course, I don't think he meant to be assigning
the variable, anyway. :-)

Chris

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




RE: [PHP] Re: amp; in Query String

2002-11-26 Thread Jonathan Rosenberg \(Tabby's Place\)
Not, this answer makes sense.  I couldn't see how using 'amp;' in the query
string would work.

I'm gonna take the advice  augment my error message to include browser name
 other info.  I've been wondering if a web crawler might be causing this.

I'll let you know what turns up (of course, the problem will stop occurring
once I add this info :-).

--
JR

 -Original Message-
 From: Erwin [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 26, 2002 10:54 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: amp; in Query String


 Derick Rethans wrote:
  Jonathan Rosenberg wrote:
  I have a page with thumbnail pictures that can be clicked on to see
  a larger picture.  Each picture is hyperlinked as follows
 
  a HREF=show_pic.php?pic=blahcaption=Some+Text
 
  I access the 'pic'  'caption' attributes with $_GET['pic'], etc.
  Pretty standard stuff.
 
  I have PHP set up so that error messages get mailed to a specified
  mail account.  Every so often I get the following error message:
 
  Undefined index:  caption
  In file /home//show_pic.php, line 64
  page: /show_pic.php?pic=gb3.jpgamp;caption=Some+Text
 
  The problem is obviously (I think) that the $_GET['caption'] is
  failing.

 True, if you receive amp;caption in your URL, then the variable won't be
 called $_GET['caption'], but $_GET['amp;caption'], which (I think) is
 invalid because of the ;.

 
  What I can't figure out is why the '' got turned into 'amp;'.  Is a
  browser doing this?

  Yes it is.

 No, it isn't. I sure hope there is no browser which turns  in amp; in
 URL's. That would be very, very bad indeed!

  Actually, you should specify the URL with the amp;
  yourself, like this:
 
  a HREF=show_pic.php?pic=blahamp;caption=Some+Text

 Of course not...this is a HREF tag, which can use  instead of
 amp;. amp;
 is for displaying purposes only, not for URL's.

 Following the tip from Marek, adjust your errormessage mailing
 thingy...add
 all the $_GET variables to it (print_r($_GET)). Some other notices maybe
 usefull to...

 Erwin


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

2002-11-26 Thread Chris Shiflett
--- Chris Boget [EMAIL PROTECTED] wrote:

  So, you are using a database to store the records?
 
 Yes.  What's the point in taking the user's information if you
 aren't going to store it somewhere. Even if all you need to do is
 email the data upon completion of the form, storing the data for
 later use would be a good idea.

Since it seems like you are inferring otherwise, I should say that a
database isn't the only way to store information.

Also, many multiple page forms like this are for some sort of user
registration or similar task where you might want the entire process
completed prior to creating a user record. Perhaps he doesn't want to
create the record in the database prior to the user finishing all the
screens.

Sessions are the more straightforward approach to keeping up with
data like this. After all, not everything warrants permanent storage,
which is why most Web applications generally have two data stores:

1. Permanent user record data store (where you might store username
and password, for example)
2. Session data store (where you might store whether a user is logged
in or keep up with form data from page to page)

Chris

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




Re: [PHP] Re: amp; in Query String

2002-11-26 Thread Erwin
 I'll let you know what turns up (of course, the problem will stop
 occurring once I add this info :-).

As it always does ;-))

Grtz Erwin

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




Re: [PHP] Re: amp; in Query String

2002-11-26 Thread @ Edwin
Hello,

Jonathan Rosenberg (Tabby's Place) [EMAIL PROTECTED] wrote:

[snip]
 I'm missing something here.  If you use 'amp;' to separate arguments on
the
 query string, how do they get separated out for access via $_GET?
[/snip]

Don't worry about it, just try it :)

Anyway, the link that has amp; would be translated to . (The browser
should take care of this since it's the proper way to do it anyway...)

- E

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




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
  Yes.  What's the point in taking the user's information if you
  aren't going to store it somewhere. Even if all you need to do is
  email the data upon completion of the form, storing the data for
  later use would be a good idea.
 Since it seems like you are inferring otherwise, I should say that a
 database isn't the only way to store information.

Of course there are.  And if I infered otherwise, that was not my 
intention.
 
 Also, many multiple page forms like this are for some sort of user
 registration or similar task where you might want the entire process
 completed prior to creating a user record. Perhaps he doesn't want to
 create the record in the database prior to the user finishing all the
 screens.

But even incomplete records can have useful information.  What page did 
the user stop at, for example.  Keeping this kind of data in a permanent
store has use even beyond the application.

 Sessions are the more straightforward approach to keeping up with
 data like this. 

Perhaps.  Depends on what, ultimately, you want to use the data for.

 After all, not everything warrants permanent storage,
 which is why most Web applications generally have two data stores:
 1. Permanent user record data store (where you might store username
 and password, for example)
 2. Session data store (where you might store whether a user is logged
 in or keep up with form data from page to page)

We always have a permanent store, keeping even the incomplete records.
It helps us out in alot of other ways.

Chris


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




Re: [PHP] Multiple page form

2002-11-26 Thread @ Edwin

Chris Boget [EMAIL PROTECTED] wrote:

  So, you are using a database to store the records?
 
 Yes.  What's the point in taking the user's information if you aren't
 going to store it somewhere.  Even if all you need to do is email
 the data upon completion of the form, storing the data for later use
 would be a good idea.

Not always. Are your users aware of this?

Just wondering...

- E

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




RE: [PHP] Re: amp; in Query String

2002-11-26 Thread Chris Shiflett
--- Jonathan Rosenberg (Tabby's Place) [EMAIL PROTECTED] wrote:

 In an earlier message, Derick Rethans [mailto:[EMAIL PROTECTED]] said
 
  Yes it is. Actually, you should specify the URL with the
  amp; yourself, like this:
 
  a HREF=show_pic.php?pic=blahamp;caption=Some+Text
 
  otherwise it is not valid HTML.
 
 I understand that using '' is technically not correct HTML.

Actually, I think he might have meant XHTML. I'm not sure though.

If your syntax looks like this:

a href=show_pic.php?pic=blahamp;caption=Some+Text

Then your Web browser should interpret the amp; as an HTML entity
and send a GET request (when you click the link) to:

show_pic.php?pic=blahcaption=Some+Text

Meaning, if show_pic.php receives $_GET[amp;caption] as someone
else mentioned, the browser has failed.

 But I don't see how changing the '' - 'amp;' solves my problem.

I think your intuition has served you well. From your initial
description, it sounds like your problm is that you write this:

a href=show_pic.php?pic=blahcaption=Some+Text

And the browser sends a GET request to:

show_pic.php?pic=blahamp;caption=Some+Text

If this is true, this seems like an obvious browser bug to me. I
agree with the other suggestions to beef up the debugging information
you mail yourself, since I'm assuming you can't reproduce this on
your own. Look at all of the $_GET variables, the user agent, and
anything else you can think of.

Oh, I assume your past emails have had timestamps. I would recommend
looking through your Web server's access logs, and see if you can
locate the request that returned an error. See if the URL being
requested has the amp; in it (which it should not).

 I'm missing something here. If you use 'amp;' to separate
 arguments on the query string, how do they get separated out for
 access via $_GET?

Because you are writing the amp; in the HTML source code. The
browser should interpret this as  prior to sending the GET request
to the Web server.

Hope that helps.

Chris

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




Re: [PHP] Multiple page form

2002-11-26 Thread Chris Boget
  Yes.  What's the point in taking the user's information if you aren't
  going to store it somewhere.  Even if all you need to do is email
  the data upon completion of the form, storing the data for later use
  would be a good idea.
 Not always. Are your users aware of this?
 Just wondering...

Yes.
Though, the later use I refer to is internal only.  We sell no data.

Chris


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




[PHP] Re: PHP] can't pass complete URL (part of the query string) from

2002-11-26 Thread Nicole Lallande
Dear Martin  Erwin,

Tried the urlencode - same thing happened - the variables after the 
first one were chopped off - so

a href=email.php?ref=?=urlencode($pageURL);?this page/a

where the url is

http://mydomain.com/displayem.php3?cat=5olimit=0zid=1lid=1

results in http://mydomain.com/displayem.php3?cat=5 being passed and

the 'olimit=0zid=1lid=1' gets cut off - still??  

Thanks,

Nicole
hi nicole,

do you have an example what your query contains ?
maybe urlencode($pageURL) or quoting will help

greetings martin

 -Urspr\xfcngliche Nachricht-
 Von: Nicole Lallande [mailto:[EMAIL PROTECTED]]
 Gesendet: Dienstag, 26. November 2002 15:40
 An: [EMAIL PROTECTED]
 Betreff: [PHP] can't pass complete URL (part of the query string) from
 one script to another --??


 Gretings:

 I want to pass a URL query string to another php script.  I
 am able to
 pass the complete query string with all the variables I want
 through to

--

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766




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



Re: [PHP] Re: PHP] can't pass complete URL (part of the query string) from

2002-11-26 Thread Chris Shiflett
--- Nicole Lallande [EMAIL PROTECTED] wrote:

 a href=email.php?ref=?=urlencode($pageURL);?this page/a
 
 where the url is
 
 http://mydomain.com/displayem.php3?cat=5olimit=0zid=1lid=1
 
 results in http://mydomain.com/displayem.php3?cat=5 being passed
 and the 'olimit=0zid=1lid=1' gets cut off

Can you visit this page, view source, and show us what the a href
tag looks like after it is processed by PHP?

Chris

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




[PHP] spawing new PHP process

2002-11-26 Thread ROBERT MCPEAK
I'm interested in spawing a new PHP process -- if that's the correct terminology.

The situation is that I've got a very slow loading page, where, for example, I'm using 
PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is firing 
out the emails, it appears to the user that page is hanging.  I'd like to somehow send 
that process to the background and let the page load straight-away.

In another scripting language I've used, this function was called spawn.

Do we have something like this in PHP (I know we do!! Just can't find it.) I've looked 
through the docs but don't see what I'm looking for.

Thanks in advance.

-Bob


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




RE: [PHP] Re: Sorting parsed XML

2002-11-26 Thread Chris
Okay, that's neat and I get what you're saying with xml_process() to
handle this.

From what I'm reading, it would not allow this sort of procedure, but
please let me know otherwise:

==
echo td . $ServerName;
if ($ServerType)
{
echo  i( . $ServerType . )/i/td\n;
} else {
echo /td\n;
}

if ($ServerStatus == Down)
{
echo tdi . $ServerStatus . /i/td\n;
} else {
echo td . $ServerPopulation . /td\n;
}
==

So, what would print in the first and 2nd column would depend upon the
results of one of two variables (1st column relies upon if there's a
$ServerType or not, 2nd column relies upon the $ServerStatus not being
Down).

My problem is still my own, I can't get it so that when I parse, the
information is placed into an array that can then be used for sorting.
This would be ideal for me as I plan on reading from more than one .xml
(different structures as well) on the same page if I can get this to
work.

I guess what I'm asking for is a method to parse information into an
array and then sort it by any part of the array.  I attempted the
$ServerArray[$this-ServerName][$this-ServerStatus] = $data in the
parse section (where $data = current node value), but it didn't work.

Again, thanks for all your help so far and in advance for any help you
can provide.

~Confused PHP user

 From: @ Edwin [mailto:[EMAIL PROTECTED]] 
 
 Geoff Hankerson [EMAIL PROTECTED] wrote:
 
  You don't need to do client-side transformation (although you could 
  check user agent and do it client-side if the browser supports it). 
  You can use Php's XSLT functions see the manual for more info.
 
  I was just suggesting this as a potential option. It may not be 
  appropriate in this situation. I don't really know enough about the 
  programming challenge we are looking at  to say for sure
 
 I see. I thought you were saying that use XSLT and access the 
 xml file directly--my apologies.
 
 Anyway, _that_ is certainly a potential option... :)


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




Re: [PHP] spawing new PHP process

2002-11-26 Thread Rasmus Lerdorf
The correct solution for this particular problem is to just queue the
outbound mail and have your MTA deliver them out of band.  man sendmail

-Rasmus

On Tue, 26 Nov 2002, ROBERT MCPEAK wrote:

 I'm interested in spawing a new PHP process -- if that's the correct terminology.

 The situation is that I've got a very slow loading page, where, for example, I'm 
using PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is 
firing out the emails, it appears to the user that page is hanging.  I'd like to 
somehow send that process to the background and let the page load straight-away.

 In another scripting language I've used, this function was called spawn.

 Do we have something like this in PHP (I know we do!! Just can't find it.) I've 
looked through the docs but don't see what I'm looking for.

 Thanks in advance.

 -Bob


 --
 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] spawing new PHP process

2002-11-26 Thread Marco Tabini
Assuming you're working on UNIX--you need to use one of the execute
functions (search for exec in the manual). You can spawn a separate PHP
in the background in a number of way, for example, by using the screen
program. 

If I remember correctly, you can't instantiate it directly and run it in
the background because PHP does not close stdout and stderr--but this
might have changed and/or I may be mistaken (nothing new there).


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

---BeginMessage---
I'm interested in spawing a new PHP process -- if that's the correct terminology.

The situation is that I've got a very slow loading page, where, for example, I'm using 
PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is firing 
out the emails, it appears to the user that page is hanging.  I'd like to somehow send 
that process to the background and let the page load straight-away.

In another scripting language I've used, this function was called spawn.

Do we have something like this in PHP (I know we do!! Just can't find it.) I've looked 
through the docs but don't see what I'm looking for.

Thanks in advance.

-Bob


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



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


[PHP] Re: Multiple page form

2002-11-26 Thread Manuel Lemos
Hello,

On 11/26/2002 01:42 PM, Shane McBride wrote:

It's been a while since I have done any PHP work. I am creating an online
employment application using multiple forms for a client. I was going to use
PHP. I don't remember if I need to pass variables along with the form for
each page, or can I just call them on the last page.

The application form is very long. Any ideas? There may be a script that
exists already?


Yes, you may want to try this class. It lets you compose and process 
multipage forms in two modes: sequential access (wizard like with 
buttons Next ,  Back, Finish  and cancel) and random access 
(tabbed pages like with edit or view only modes).

http://www.phpclasses.org/multipageforms


http://www.phpclasses.org/browse.html/file/348/view/1/name/test_random_form_page.html

http://www.phpclasses.org/browse.html/file/349/view/1/name/test_sequential_form_page.html

--

Regards,
Manuel Lemos


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



[PHP] Re: suEXEC and PHP

2002-11-26 Thread Serge A.
Hi,

suEXEC will only work if PHP is installed as CGI, not Apache module...

Regards,
Serge


 Hi,

 Apache 1.3.24, PHP 4.2.2

 I am running a php script which executes something like

 system(scp -r -S ssh host1:/home/dir host2:/home);

 The scp command executes as the apache user, in my case 'nobody'. This
does
 not work, as the ssh authentication is not set up for user 'nobody' nor
 should it be. Setting a different user, as in scp -r -S ssh
 myuser@host1:/home/dir myuser@host2:/home deosn't work, ssh still tries
to
 authenticate 'nobody'.

 First I tried running apache as a different user, 'apache', after setting
up
 the rsa keys etc (ssh stuff) for 'apache'. The authentication then works
but
 there are issues of the 'apache' user having read/write permissions on the
 directories host1:/home/dir and host2:/home. I thought that giving the
 'apache' user permission to read/write these directories wasn't a very
good
 idea.

 Now I am trying to use the apache suEXEC feature to do this, so that my
php
 script can run as a different user (eg. myuser) who has all the right
 permissions and ssh configured. However, so far I have been unsccessful
and
 suspect that suEXEC will not work with PHP. Does anyone out there have
 experience with this? Any advice would be appreciated.

 tia,

 Rich




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




Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Ernest E Vogelsinger
At 16:45 26.11.2002, Chris Shiflett spoke out and said:
[snip]
--- Ernest E Vogelsinger [EMAIL PROTECTED] wrote:

 At 13:50 26.11.2002, [EMAIL PROTECTED] said:
 if ($lineone  $linetwo  $linethree  $linefour = )

 Your expression yields true if 1-3 are not-empty AND four is an
 empty string.

Actually, this expression yields true when $lineone, $linetwo, and
$linethree are all true. The variable $linefour is just being set to
the empty string.

You're so right - I think I need new glasses...

Thanks for setting this straight :)


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] If statement w/ multiple conditions

2002-11-26 Thread Chris Shiflett
--- Ernest E Vogelsinger [EMAIL PROTECTED] wrote:

  if ($lineone  $linetwo  $linethree  $linefour = )
 
  Your expression yields true if 1-3 are not-empty AND four is an
  empty string.
 
  Actually, this expression yields true when $lineone, $linetwo,
and
  $linethree are all true. The variable $linefour is just being set
  tothe empty string.
 
 You're so right - I think I need new glasses...
 
 Thanks for setting this straight :)

No problem, except I was wrong, too. :-) Because $linefour is being
set to the empty string, it will evaluate to false, causing the
entire statement to always evaluate to false.

Chris

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




Re: [PHP] Re: amp; in Query String

2002-11-26 Thread Ernest E Vogelsinger
At 16:54 26.11.2002, Erwin spoke out and said:
[snip]
 Actually, you should specify the URL with the amp;
 yourself, like this:

 a HREF=show_pic.php?pic=blahamp;caption=Some+Text

Of course not...this is a HREF tag, which can use  instead of amp;. amp;
is for displaying purposes only, not for URL's.

Nope. As I just learnt from this list it _is_ valid to specify a query
string using amp; as delimiter - it will be resolved by the browser the
same way as it is when it gets displayed.

Actually this is the only way to create W3C-compliant query strings.

Just check with the W3C HTML Validator: http://validator.w3.org/


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] spawing new PHP process

2002-11-26 Thread Adam Voigt
Have your page before the email's would actually be sent, submit to a
page with a frameset, in the bottom frame have a height of 1 pixel so
that it's invisible. Then, in your PHP page, add something like:

script language=javascript
parent.topframe.progress.value =
eval(parent.topframe.progress.value)+1;
/script

Have that print after every iteration of a mail being sent, and ofcourse
you would have to create the necessary text boxes on your top frame and
everything, but that would make it appear to be working to the user
because the count of email's being sent would keep going up till it was
done.

On Tue, 2002-11-26 at 11:41, ROBERT MCPEAK wrote:
 I'm interested in spawing a new PHP process -- if that's the correct terminology.
 
 The situation is that I've got a very slow loading page, where, for example, I'm 
using PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is 
firing out the emails, it appears to the user that page is hanging.  I'd like to 
somehow send that process to the background and let the page load straight-away.
 
 In another scripting language I've used, this function was called spawn.
 
 Do we have something like this in PHP (I know we do!! Just can't find it.) I've 
looked through the docs but don't see what I'm looking for.
 
 Thanks in advance.
 
 -Bob
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



signature.asc
Description: This is a digitally signed message part


[PHP] Re: PHP] can't pass complete URL (part of the query string) from

2002-11-26 Thread Nicole Lallande
Chris -- thanks! didn't think to look - the 'ref' variable is being 
passed correctly in the form action=:

form action=http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5olimit=0zid=1lid=1; method=post

but below in the text area where I display it:

?php echo $ref; ? or even ?php echo $_GET['ref']; ?

it comes out as:

http://embitec.com/fishcart/displayem.php3?cat=5

???

Best,

Nicole



--- Nicole Lallande [EMAIL PROTECTED] wrote:

 a href=email.php?ref=?=urlencode($pageURL);?this page/a

 where the url is

 http://mydomain.com/displayem.php3?cat=5olimit=0zid=1lid=1

 results in http://mydomain.com/displayem.php3?cat=5 being passed
 and the 'olimit=0zid=1lid=1' gets cut off

Can you visit this page, view source, and show us what the a href
tag looks like after it is processed by PHP?

Chris

--

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766




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



Re: [PHP] Re: PHP] can't pass complete URL (part of the query string) from

2002-11-26 Thread Chris Shiflett
--- Nicole Lallande [EMAIL PROTECTED] wrote:

 form
action=http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5olimit=0zid=1lid=1;
method=post

There is your problem right there. Here are the variables you are
passing:

ref=http://embitec.com/fishcart/displayem.php3?cat=5
olimit=0
zid=1
lid=1

The URL you want to set ref to needs to be URL encoded. You can use
rawurlencode() to achieve this. You will know you have it right when
your HTML form tag looks like this:

form
action=http://embitec.com/fishcart/email.php?ref=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D5%26olimit%3D0%26zid%3D1%26lid%3D1;
method=post

Hope that helps.

Chris

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




[PHP] FTP and security

2002-11-26 Thread Richard Fox

My company, as a matter of policy, closes the ftp ports of the servers in the DMZ. 
However, I am not convinced that this is necessary, given the advent of very secure 
ftp servers. I would appreciate any comments on the security of an open ftp port. To 
relate this to php, I am ready to give up trying to make my 

system(scp ..);

code work, because I will have to give the apache user more permissions than I am 
comfortable with. So, I am thinking fo using php's ftp commands instead. I see nowhere 
in the documentation however, if the ftp_connect can be done via the ssh transport 
mechanism. Or, is this unnecessary, and can I use ftp (with plain text user and 
password passed to ftp_login()) on port 21 without worrying about getting hacked? 

muchas gracias

Rich



Re: [PHP] FTP and security

2002-11-26 Thread Marco Tabini
Rich,

Why don't you create an ssh tunnel between your two boxes and then
perform you ftp connection through there? This way, the connection would
be secure and you could impersonate whichever user you need to.

There is also a secure version of ftp, but I don't think that it can be
instantiated directly from PHP, and you would therefore have to run it
from a shell, which would give the same problems you have with ssh now.


Marco

-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

---BeginMessage---

My company, as a matter of policy, closes the ftp ports of the servers in the DMZ. 
However, I am not convinced that this is necessary, given the advent of very secure 
ftp servers. I would appreciate any comments on the security of an open ftp port. To 
relate this to php, I am ready to give up trying to make my 

system(scp ..);

code work, because I will have to give the apache user more permissions than I am 
comfortable with. So, I am thinking fo using php's ftp commands instead. I see nowhere 
in the documentation however, if the ftp_connect can be done via the ssh transport 
mechanism. Or, is this unnecessary, and can I use ftp (with plain text user and 
password passed to ftp_login()) on port 21 without worrying about getting hacked? 

muchas gracias

Rich

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


[PHP] Re: PHP] can't pass complete URL (part of the query string)

2002-11-26 Thread Nicole Lallande
Chris -
Tried that -- I have urlencode in the script that sends the url and I 
have url encode right below the form action -- ref is getting cut off at 
the first ampersand - regardless:

where:
form
action=http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5olimit=0zid=1lid=1;
method=post
and:

input type=hidden name=ref value? php echo rawurlencode($ref); ?
or even
input type=hidden name=ref value? php echo rawurlencode($_GET['ref']); ?

yields:

input type=hidden name=ref value=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D4


still cutting off everything after the ampersand..??

Best,

Nicole

form
action=http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5olimit=0zid=1lid=1;
method=post

There is your problem right there. Here are the variables you are
passing:

ref=http://embitec.com/fishcart/displayem.php3?cat=5
olimit=0
zid=1
lid=1

The URL you want to set ref to needs to be URL encoded. You can use
rawurlencode() to achieve this. You will know you have it right when
your HTML form tag looks like this:

form
action=http://embitec.com/fishcart/email.php?ref=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D5%26olimit%3D0%26zid%3D1%26lid%3D1;
method=post

Hope that helps.

Chris

--

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766




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



[PHP] PHP/MySQL Installation

2002-11-26 Thread manh
Hello,

I am a beginner of PHP/MySQL. I have tried several times to install PHP3
and MySQL (free products) to conduct some web pages for my company, but
lots of trouble came up. I just followed the instruction on www.php.net
but it did not help.

Can you help me? Thanks.

Manh.
[EMAIL PROTECTED]


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




Re: [PHP] Linux Question

2002-11-26 Thread Brian V Bonini
On Mon, 2002-11-25 at 20:22, Justin French wrote:

 
 I don't think I was being clear enough at all :)  12px is 12pixels... there
 is no way for it to *reliably* be reset to 14px, or 10px by the user on all
 browser.

That's like saying 10% is 10%. 10% of what? The physical size of a pixel
varies depending on the device therefore it is not static.

You said px is absolute and even tried to quote from the spec albeit
there was no such quote at the location you cited.

So again, I WILL quote directly from the spec:

-- SNIP --

There are two types of length units: relative and absolute. Relative
length units specify a length relative to another length property. Style
sheets that use relative units will more easily scale from one medium to
another (e.g., from a computer display to a laser printer).

Relative units are:

* em: the 'font-size' of the relevant font
* ex: the 'x-height' of the relevant font
* px: pixels, relative to the viewing device 

-- END SNIP --

I'm pretty sure that says px is a relative unit

http://www.w3.org/TR/REC-CSS2/syndata.html#length-units

section 4.3.2


 
 In the current versions of IE for Win, using the text size larger smaller or
 % options in the menus has no effect whatsoever if values like 12px or 12pt
 are given.

Sounds like just one more reason in the long list of reasons not to use
MS software.

But, you are correct and if this is an issue then it needs to be
addresses accordingly.

However, if memory serves, the original question was how to get fonts to
appear more consistent in size across varying platforms and browsers.
Not accessibility issues. I believe I did provide the solution for that.
Like I said, try it, then we can debate... ;-)


 
 So, I stand partially corrected, the user CAN override ALL font size by
 digging into the accessibility menus, but I seriously doubt many do.

Well, really all you have to do is check the ignore font sizes in the
accessibility menu. But again, the fact that IE does not allow resizing
sounds more like an IE specific issue (bug if you will) especially since
every other browser I know of does allow it.

 
 If the latest versions of IE *DO* allow text zooming via the menus, again I
 stand corrected, but there are millions of web users out there on IE5 and
 IE6 without text zoom.  IMO, specifying a px or pt font size is taking away
 the users right to choose what font size they prefer to read with, IF they
 are using IE4/5/6.

Well, I guess, but I think MS took that decision away, not the site
author. Your always free to use NN, or Mozilla, or Opera.

Anyway, besides you mis-quoting the spec I am just arguing for the sake
of argument. Accessibility is an issue that should be addressed even if
Microsuck can't do it themselves and does not have the insight to make a
more user friendly method of controlling font sizes for the end user.
But, non of this really has anything to do with the original question.
And, it is certainly WAY off topic for the PHP list.

Peace,
-Brian
***




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




[PHP] Re: IIS and PHP with $HTTP_SERVER_VARS

2002-11-26 Thread Brian McGarvie
it's to do with probably folder permissions, the folder all your web files
are should have IUSR_machinename added to the folder with full rights, the
login box should then not appear...

Shaun Garriock [EMAIL PROTECTED] wrote in message
018301c2954d$265b4010$c101a8c0@rgcweb01">news:018301c2954d$265b4010$c101a8c0@rgcweb01...
Hi
The problem I am having is as follows:
I setup PHP with IIS and it seems to work fine. I am creating a Intranet
site and would like to obtain the user logged on to the networks
username. I have setup basic auth but when I visit the site it asks me
for my username and password before I can get in. Integrated Windows
Auth is turned off. When I turn it on and try to login it says login
failed. I know that ASP can have a script added to the page to turn pass
through auth but I need one for PHP.
I am using $HTTP_SERVER_VARS[LOGON_USER] to get the username and it
works when I login. I just need to get rid of the login box.

Thanks for your help in advance.

Shaun Garriock


*** The contents of this message are confidential and are intended for the
addressee only. The views expressed in this message do not necessarily
represent those of Robert Gordon's College. Electronic mail transmission is
not guaranteed to be secure, therefore, Robert Gordon's College does not
accept liability for the contents of this transmission. This message does
not form a legal binding contract. ***



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




Re: [PHP] Re: PHP] can't pass complete URL (part of the query string)

2002-11-26 Thread Chris Shiflett
--- Nicole Lallande [EMAIL PROTECTED] wrote:

 Tried that

I'm thinking you haven't, but I might be wrong. The HTML you showed
us previously was of a form tag. The action attribute of that form
tag is where your problem lies.

form
action=http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5olimit=0zid=1lid=1;
method=post

See? It is still wrong. Remember, you will know when you fix your
problem when this form tag looks like this:

form
action=http://embitec.com/fishcart/email.php?ref=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D5%26olimit%3D0%26zid%3D1%26lid%3D1;
method=post

Yours still does not look like this.

 input type=hidden name=ref value? php echo
rawurlencode($ref); ?

See, I am guessing that you are doing this on the next page. Meaning,
you are URL encoding this:

http://embitec.com/fishcart/displayem.php3?cat=5

This is what $_GET[ref] is going to be if you do not correct your
form tag like I am describing.

input type=hidden name=ref
value=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D4

Exactly as I would expect. Focus on fixing your form tag. This other
URL encoding you are doing on this hidden form variable is actually
unnecessary, because the browser is going to do it again for you.

Hope that clears it up for you.

Chris

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




Re: [PHP] implode()

2002-11-26 Thread Jef
 implode() expects an array as the second argument. You're passing a
string. In
 fact with the code you have above I don't see why you don't just tack the
 comma on the end in the first place:

if($image11_name != '') $sqlUpdate .= image11='$image11_name', ;

The reason being the comma at the end of the SQL command will prevent the
command from working because SQL will expect another entry. However, your
comment about implode expecting an array helps out. Thanks.




Jef



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




[PHP] re-writing to the same socket

2002-11-26 Thread Gareth Thomas
Hi,

I have some code that writes data to a socket (works fine) and stores the
resource id created in a table with the column defined as varchar (80). Then
the next time I need to write data to the same IP I retrieve the resource id
and reuse it. Problem is that the socket_write seems to work fine (it
returns no error) and yet the data appears to disappear into the ether...I
am using 4.2.3 client on Win2K and server on Linux.

Anyone have any ideas.

Any help much appreciated.

G.



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




[PHP] Re: PHP] can't pass complete URL (part of the query string) - aha-- that worked - except for the javascript

2002-11-26 Thread Nicole Lallande
Chris -- I took out the javascript call to window.open and included the 
fix the way you described it and it worked!  Thanks for clearing it up 
for me.  Now I just have to figure own why the javascript is chopping 
the variable.  Thanks for all your help!

Best regards,

Nicole




I'm thinking you haven't, but I might be wrong. The HTML you showed
us previously was of a form tag. The action attribute of that form
tag is where your problem lies.

form
action=http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5olimit=0zid=1lid=1;
method=post

See? It is still wrong. Remember, you will know when you fix your
problem when this form tag looks like this:

form
action=http://embitec.com/fishcart/email.php?ref=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D5%26olimit%3D0%26zid%3D
Yours still does not look like this.

 input type=hidden name=ref value? php echo
rawurlencode($ref); ?

See, I am guessing that you are doing this on the next page. Meaning,
you are URL encoding this:

http://embitec.com/fishcart/displayem.php3?cat=5

This is what $_GET[ref] is going to be if you do not correct your
form tag like I am describing.

input type=hidden name=ref
value=http%3A%2F%2Fembitec.com%2Ffishcart%2Fdisplayem.php3%3Fcat%3D4

Exactly as I would expect. Focus on fixing your form tag. This other
URL encoding you are doing on this hidden form variable is actually
unnecessary, because the browser is going to do it again for you.

Hope that clears it up for you.

Chris

--

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766




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



Re: [PHP] implode()

2002-11-26 Thread Jason Wong
On Wednesday 27 November 2002 02:19, Jef wrote:
  implode() expects an array as the second argument. You're passing a

 string. In

  fact with the code you have above I don't see why you don't just tack the
  comma on the end in the first place:
 
 if($image11_name != '') $sqlUpdate .= image11='$image11_name', ;

 The reason being the comma at the end of the SQL command will prevent the
 command from working because SQL will expect another entry. However, your
 comment about implode expecting an array helps out. Thanks.

Yes, but as you're building up the SQL statement manually you just leave out 
the comma off the last line!

Using implode() is appropriate if you're programatically (sp?) building an SQL 
statement using an array.

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

/*
What I need is a MATURE RELATIONSHIP with a FLOPPY DISK ...
*/


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




Re: [PHP] implode()

2002-11-26 Thread Jef
   implode() expects an array as the second argument. You're passing a
   string. In fact with the code you have above I don't see why you don't
just tack
   the comma on the end in the first place:
  
  if($image11_name != '') $sqlUpdate .= image11='$image11_name', ;
 
  The reason being the comma at the end of the SQL command will prevent
the
  command from working because SQL will expect another entry. However,
your
  comment about implode expecting an array helps out. Thanks.

 Yes, but as you're building up the SQL statement manually you just leave
out
 the comma off the last line!

 Using implode() is appropriate if you're programatically (sp?) building an
SQL
 statement using an array.

The problem is I don't know which will be the last element in the string. I
am allowing 9 images to be changed, 9 text labels to be changed, and 9 links
to be changed. I don't know which will be the last. I'm using an update sql
command to change the database when these changes are being made.

When I set the $sqlUpdate to be an array the printed result is ARRAY. When I
print the sql command it reads UPDATE mp SET ARRAY. What am I doing wrong?




Jef



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




Re: [PHP] FTP and security

2002-11-26 Thread Jason Wong
On Wednesday 27 November 2002 01:42, Richard Fox wrote:
 To relate this to php, I am ready to give up
 trying to make my

 system(scp ..);

 code work, because I will have to give the apache user more permissions
 than I am comfortable with. 

What exactly are the problems you're encountering using scp?

So, I am thinking fo using php's ftp commands
 instead. I see nowhere in the documentation however, if the ftp_connect can
 be done via the ssh transport mechanism. Or, is this unnecessary, and can I
 use ftp (with plain text user and password passed to ftp_login()) on port
 21 without worrying about getting hacked?

Well, if you're going to be using ftp-over-ssh, I don't see why you're not 
using scp directly instead.

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

/*
Those who do not do politics will be done in by politics.
-- French Proverb
*/


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




[PHP] Newbie: Can't get my PHP server to work

2002-11-26 Thread Marcos Bastian
Hello Everyone:
First of all: I've been dealing with PHP for less than 24 hours, so please
forgive me if my questions are too basic...

I'm using Xitami on a Windows 2000 server. I installed PHP and it seems to
be working fine, but then, I tried to add a few file management scripts:

PHP Commander - http://szewo.com/php/ and
QTO File Manager - http://www.qto.com/fm

Both seem to initialize correctly at first, but when I try to use the
interface - press buttons to upload files or navigate to subdirectories -
nothing happens.

I suspect that it is something related to the php server setup; I already
tried to change the INI file in my W2000 forder, allowing uploads.

My whole objective is to create a public file repository for our company.

Please? Any ideas?
Thanks in advance!
Bastian - Denver, CO.
please reply to newsgroup, or directly to bstn-spamatearthlink.net
www.bygroup.com


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




[PHP] Getting the script path of a commandline script

2002-11-26 Thread Ryan Grove
Anyone know how to get the script path (not the current working directory,
but the actual path of the executing script) of a commandline script?

I've dug through the docs and can't find this anywhere. None of the
typical $_SERVER variables return the script path (although several of
them return the filename, hooray for redundancy). The docs say several
times that getcwd() will NOT return the path of the executing script, but
they don't mention how to get it.

Help.

-- 
Ryan Grove
[EMAIL PROTECTED]
http://wonko.com/

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




Re: [PHP] implode()

2002-11-26 Thread Jason Wong
On Wednesday 27 November 2002 02:57, Jef wrote:

 The problem is I don't know which will be the last element in the string. I
 am allowing 9 images to be changed, 9 text labels to be changed, and 9
 links to be changed. I don't know which will be the last. I'm using an
 update sql command to change the database when these changes are being
 made.

Re-reading your original post I see what you mean.

 When I set the $sqlUpdate to be an array the printed result is ARRAY. When
 I print the sql command it reads UPDATE mp SET ARRAY. 

I think you mean Array. Because $sqlUpdate is an array you can't simply 
print it out (you'll just get 'Array' printed). 

 What am I doing
 wrong?

You didn't use implode(), which after all is the subject of this thread ;-)

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

/*
How many surrealists does it take to screw in a lightbulb?

One to hold the giraffe and one to fill the bathtub with brightly colored
power tools.
*/


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




Re: [PHP] implode()

2002-11-26 Thread Joakim Andersson
Jef wrote:

implode() expects an array as the second argument. You're passing a


string. In


fact with the code you have above I don't see why you don't just tack the
comma on the end in the first place:

  if($image11_name != '') $sqlUpdate .= image11='$image11_name', ;



The reason being the comma at the end of the SQL command will prevent the
command from working because SQL will expect another entry. However, your
comment about implode expecting an array helps out. Thanks.



This is how I would do it:
?php
$separator = ;
if($image11_name != '') {
	$sqlUpdate .= $separator . image11='$image11_name';
	$separator = , ;
}
if($image12_name != '') {
	$sqlUpdate .= $separator . image12='$image12_name';
	$separator = , ;
}
if($textfield11 != '') {
	$sqlUpdate .= $separator . textfield11='$textfield11';
	$separator = , ;
}
if($textfield12 != '') {
	$sqlUpdate .= $separator . textfield12='$textfield12';
	$separator = , ;
}
if($textlink11 != '') {
	$sqlUpdate .= $separator . textlink11='$textlink11';
	$separator = , ;
}
if($textlink12 != '') {
	$sqlUpdate .= $separator . textlink12='$textlink12';
	$separator = , ;
}

if($sqlUpdate != ) {
	$query = UPDATE my_table SET  . $sqlUpdate;
	// Execute query
} else {
	// Nothing to update...
}
?

Regards
Joakim


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




Re: [PHP] re-writing to the same socket

2002-11-26 Thread Matt Vos
This happens because the Resource ID is a pointer to the socket, not the
socket itself.
You are storing the value of the resource ID (i.e. '1') in the database.
However, when you are pulling it out, you are pulling it out as an int, and
not a socket identifier.
Keep the socket identifier as a global variable/pointer, or pass it through
functions with the arguments.

Matt
- Original Message -
From: Gareth Thomas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 26, 2002 1:26 PM
Subject: [PHP] re-writing to the same socket


 Hi,

 I have some code that writes data to a socket (works fine) and stores the
 resource id created in a table with the column defined as varchar (80).
Then
 the next time I need to write data to the same IP I retrieve the resource
id
 and reuse it. Problem is that the socket_write seems to work fine (it
 returns no error) and yet the data appears to disappear into the ether...I
 am using 4.2.3 client on Win2K and server on Linux.

 Anyone have any ideas.

 Any help much appreciated.

 G.



 --
 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] Bug with register_globals on versus 1 and php_value vs php_flag?

2002-11-26 Thread Daevid Vincent
I don't know if this is a known bug or it's supposed to work like this,
but after randomly trying things, this finally worked:

VirtualHost *
DocumentRoot /home/interact/public_html
ServerName interact
ServerAlias www.interact.com *.interact.*
ErrorLog logs/interact-error_log
CustomLog logs/interact-access_log common
Directory /home/interact/public_html
php_value register_globals 1
/Directory
/VirtualHost


Whereas:

Directory /home/interact/public_html
php_flag register_globals on
/Directory

Didn't work (as I would assume it should)

I'm running:

PHP 4.2.2
Apache 2.0.40
Zend engine 1.2.0
RedHat 8.0
Kernel 2.4.18


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




[PHP] IE Problems: disappearing text with 'Back' button

2002-11-26 Thread Andre Dubuc
A few people using IE have complained that when they click the 'Back' button 
to edit their registration form, all info is lost and they're presented with 
a blank form.

I've read archives on this, and I really don't know what to do. The referring 
page starts with 

?php session_start()  ob_start(); ? and I know the session variables are 
passed. The referring page is headered to the check page where users would 
click 'Back'

The session variables are there too. Is there some way that I could:

(a)  Prevent the 'blank-form-syndrome'

or

(b)  Encode the input type=text size=20 name=rfname so that the name is 
filled in  - I've tried:

input type=text size=20 name=rsname ?php if($_SESSION['rfname'] != 
''){print value='{$_SESSION['rfname']}'';}

but I just get a ? in the value field, not the name.

or 

(c)  As much as hate to use it, javascript. I've coded everything without it, 
so only if I can't accomplish a reasonable approximation of 'Back' in a php 
hack.

or

(d)I read in one of the last archived messages about a workaround. After the 
user clicks 'Back' and is confronted with a now-virgin form,  all they have 
to do is click 'Refresh' in IE. Question is, does IE have a 'Refresh' button, 
and does this, in fact, work? I have no way of testing this since I only have 
Linux running. So, if some kind soul could verify whether this is true, it 
would save me a whole pile of coding! 

I would be very grateful for any suggestions on to retrieve hyper-lost data 
input using php.

Tia, Andre




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




Re: [PHP] FTP and security

2002-11-26 Thread Richard Fox
  To relate this to php, I am ready to give up
  trying to make my
 
  system(scp ..);
 
  code work, because I will have to give the apache user more permissions
  than I am comfortable with.

 What exactly are the problems you're encountering using scp?


I created an apache user, which I called apache, and  made sure this user
could connect to the remote servers and created rsa keys so no passwords
would be necessary (so my system($cmd) call would work). This is what
happens when I run scp:

bash-2.05a$ scp -pvr -S ssh apache@thor:/home/web/testsite/cgi-bin
apache@loki:/home/web/testsite
Executing: ssh -v -x -o'FallBackToRsh no' -o'ClearAllForwardings yes' -n -l
apache thor scp -v -r -p /home/web/testsite/cgi-bin
'apache@loki:/home/web/testsite'
OpenSSH_3.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug1: restore_uid
debug1: ssh_connect: getuid 48 geteuid 0 anon 1
debug1: Connecting to thor [127.0.0.1] port 22.
debug1: temporarily_use_uid: 48/48 (e=0)
debug1: restore_uid
debug1: temporarily_use_uid: 48/48 (e=0)
debug1: restore_uid
debug1: Connection established.
debug1: read PEM private key done: type DSA
debug1: read PEM private key done: type RSA
debug1: identity file /home/apache/.ssh/identity type -1
debug1: identity file /home/apache/.ssh/id_rsa type 1
debug1: identity file /home/apache/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.1p1
debug1: match: OpenSSH_3.1p1 pat OpenSSH*
Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.1p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server-client aes128-cbc hmac-md5 none
debug1: kex: client-server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 135/256
debug1: bits set: 1551/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'thor' is known and matches the RSA host key.
debug1: Found key in /home/apache/.ssh/known_hosts:1
debug1: bits set: 1576/3191
debug1: ssh_rsa_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue:
publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: try privkey: /home/apache/.ssh/identity
debug1: try pubkey: /home/apache/.ssh/id_rsa
debug1: input_userauth_pk_ok: pkalg ssh-rsa blen 149 lastkey 0x8086d50 hint
1
debug1: read PEM private key done: type RSA
debug1: ssh-userauth2 successful: method publickey
debug1: fd 4 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.
debug1: ssh_session2_setup: id 0
debug1: Sending command: scp -v -r -p /home/web/testsite/cgi-bin
apache@loki:/home/web/testsite
debug1: channel request 0: exec
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug1: channel 0: read=0 rfd 4 len 0
debug1: channel 0: read failed
debug1: channel 0: close_read
debug1: channel 0: input open - drain
debug1: channel 0: ibuf empty
debug1: channel 0: send eof
debug1: channel 0: input drain - closed

There is more output, but as you can see the read of the src files failed
and an empty ibuf is sent. This command line call works if I am a normal
user for whom I have set up known_hosts and authorized_keys. But the above
is the result when I run scp as user 'apache'.


 So, I am thinking fo using php's ftp commands
  instead. I see nowhere in the documentation however, if the ftp_connect
can
  be done via the ssh transport mechanism. Or, is this unnecessary, and
can I
  use ftp (with plain text user and password passed to ftp_login()) on
port
  21 without worrying about getting hacked?

 Well, if you're going to be using ftp-over-ssh, I don't see why you're not
 using scp directly instead.


I thought that if I create an ssh tunnel for ftp, I could use the php ftp
functions, they would actually be using ssh transparently.

Rich


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




[PHP] decimal places

2002-11-26 Thread Bryan Koschmann - GKT
Hello,

Does anyone here have a good way to make sure dollar amounts are formatted
properly? I have something that returns data, but the problem is it's
stored where any trailing zero isn't kept, like this:

$16.95 or $172.82 are fine

$17.90 or $190.20 come back as $17.9 and $190.2

I would like to make sure they are all properly formatted. Any ideas?

Thanks in advance,

Bryan


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




Re: [PHP] Getting the script path of a commandline script

2002-11-26 Thread DL Neil
Ryan,


 Anyone know how to get the script path (not the current working directory,
 but the actual path of the executing script) of a commandline script?

 I've dug through the docs and can't find this anywhere. None of the
 typical $_SERVER variables return the script path (although several of
 them return the filename, hooray for redundancy). The docs say several
 times that getcwd() will NOT return the path of the executing script, but
 they don't mention how to get it.


_SERVER[argv] [ 0 ] gives the full path to the script (including the
script's name and filetype)

=dn

PS if you want to know more, run the standard PHPINFO() through the command
line, piping to an output.HTML file, then drop that into your browser!


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




RE: [PHP] Bug with register_globals on versus 1 and php_value vs php_flag?

2002-11-26 Thread Ford, Mike [LSS]
 -Original Message-
 From: Daevid Vincent [mailto:[EMAIL PROTECTED]]
 Sent: 26 November 2002 19:23
 To: [EMAIL PROTECTED]
 Subject: [PHP] Bug with register_globals on versus 1 and php_value vs
 php_flag?
 
 
 I don't know if this is a known bug or it's supposed to work 
 like this,
 but after randomly trying things, this finally worked:
 
 VirtualHost *
 DocumentRoot /home/interact/public_html
 ServerName interact
 ServerAlias www.interact.com *.interact.*
 ErrorLog logs/interact-error_log
 CustomLog logs/interact-access_log common
 Directory /home/interact/public_html
 php_value register_globals 1
 /Directory
 /VirtualHost
 
 
 Whereas:
 
 Directory /home/interact/public_html
 php_flag register_globals on
 /Directory
 
 Didn't work (as I would assume it should)

Guess you missed the following note:

  Note: PHP constants do not exist outside of PHP. For example,
  in httpd.conf you can not use PHP constants such as E_ALL or
  E_NOTICE to set the error_reporting directive as they will have
  no meaning and will evaluate to 0. Use the associated bitmask
  values instead. These constants can be used in php.ini 

in http://www.php.net/manual/en/configuration.changes.php

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] spawing new PHP process

2002-11-26 Thread ROBERT MCPEAK
Rasmus,

Thanks for you reply.  I agree that what you suggest is the correct solution for the 
mail delivery scenario I used as an example.

My example was poor in that in limited the scope of what I was asking.

I have other situations where I would like to somehow spawn a new php process so 
that the page loads quickly and my user doesn't get frustrated or confused.

Another such situation would be when I do time consuming operations on a MySql table, 
such as building an index or loading data.  These operations may take several minutes 
and I'd like to avoid having to make my user wait for the page to load.

What is the correct solution for this problem?

I'm a newcomer to PHP, am quite excited by it, and really appreciate your insight.

Thanks,

Bob

 Rasmus Lerdorf [EMAIL PROTECTED] 11/26/02 11:46AM 
The correct solution for this particular problem is to just queue the
outbound mail and have your MTA deliver them out of band.  man sendmail

-Rasmus

On Tue, 26 Nov 2002, ROBERT MCPEAK wrote:

 I'm interested in spawing a new PHP process -- if that's the correct terminology.

 The situation is that I've got a very slow loading page, where, for example, I'm 
using PHP to send, say, 1000 emails.  The user clicks submit, and, although PHP is 
firing out the emails, it appears to the user that page is hanging.  I'd like to 
somehow send that process to the background and let the page load straight-away.

 In another scripting language I've used, this function was called spawn.

 Do we have something like this in PHP (I know we do!! Just can't find it.) I've 
looked through the docs but don't see what I'm looking for.

 Thanks in advance.

 -Bob


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




  1   2   >