|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Tue Nov 26 2002 - 17:07:54 CST
php-general Digest 26 Nov 2002 23:07:54 -0000 Issue 1728
Topics (messages 126069 through 126200):
Re: array manipulations
126069 by: Marek Kilimajer
session.save_path = /dev/shm
126070 by: Jacob Larsen
126072 by: Jacob Larsen
Re: Missing images
126071 by: Martin Johansson
calling a php function
126073 by: Adrian Partenie
126074 by: John Nichel
store images in mysql tables
126075 by: Vivek Kedia
126076 by: Justin French
126082 by: Martin Johansson
If statement w/ multiple conditions
126077 by: ed.home.homes2see.com
126078 by: Ernest E Vogelsinger
126081 by: ed.home.homes2see.com
126083 by: DL Neil
126084 by: ed.home.homes2see.com
126089 by: Craig
126091 by: Craig
126092 by: ed.home.homes2see.com
126101 by: Chris Shiflett
126109 by: Jason Wong
126113 by: Chris Shiflett
126131 by: Ernest E Vogelsinger
126132 by: Chris Shiflett
IIS and PHP with $HTTP_SERVER_VARS
126079 by: Shaun Garriock
126085 by: Brian McGarvie
Re: Automajickally POST to a remote form
126080 by: Kris Williams
passing complete URL through php scripts using javascript popup
126086 by: Nicole Lallande
Re: eq to mysql_insert_id
126087 by: Mirek Novak
Re: Sorting parsed XML
126088 by: Geoff Hankerson
126103 by: . Edwin
126125 by: Chris
base64_decode()
126090 by: Cenk Uysal
can't pass complete URL (part of the query string) from one script to another --??
126093 by: Nicole Lallande
126096 by: Martin Lucas
126097 by: Erwin
Re: More mail() questions.
126094 by: 1LT John W. Holmes
126095 by: 1LT John W. Holmes
using mbstring without having /configure'd it
126098 by: Oliver Spiesshofer
126102 by: Erwin
126108 by: . Edwin
Multiple page form
126099 by: Shane McBride
126100 by: Chris Boget
126104 by: Chris Shiflett
126105 by: Shane McBride
126111 by: Chris Boget
126115 by: Chris Shiflett
126118 by: Chris Boget
126119 by: . Edwin
126121 by: Chris Boget
126129 by: Manuel Lemos
126177 by: . Nilaab
126187 by: Jason Wong
126193 by: 1LT John W. Holmes
Re: & in Query String
126106 by: Erwin
126112 by: Jonathan Rosenberg \(Tabby's Place\)
126114 by: Jonathan Rosenberg \(Tabby's Place\)
126116 by: Erwin
126117 by: . Edwin
126120 by: Chris Shiflett
126133 by: Ernest E Vogelsinger
126195 by: Jonathan Rosenberg \(Tabby's Place\)
126198 by: Jonathan Rosenberg \(Tabby's Place\)
using declare .. ticks functionality
126107 by: Simon Taylor
Re: Starting an application on web server
126110 by: Erwin
Re: PHP] can't pass complete URL (part of the query string) from
126122 by: Nicole Lallande
126123 by: Chris Shiflett
126135 by: Nicole Lallande
126136 by: Chris Shiflett
spawing new PHP process
126124 by: ROBERT MCPEAK
126126 by: Rasmus Lerdorf
126127 by: Marco Tabini
126134 by: Adam Voigt
126160 by: ROBERT MCPEAK
126163 by: Rasmus Lerdorf
suEXEC and PHP
126128 by: Richard Fox
126130 by: Serge A.
FTP and security
126137 by: Richard Fox
126138 by: Marco Tabini
126148 by: Jason Wong
126156 by: Richard Fox
126171 by: Bryan Koschmann - GKT
126173 by: Marco Tabini
Re: PHP] can't pass complete URL (part of the query string)
126139 by: Nicole Lallande
126142 by: Chris Shiflett
PHP/MySQL Installation
126140 by: manh
Re: Linux Question
126141 by: Brian V Bonini
Re: implode()
126143 by: Jef
126146 by: Jason Wong
126147 by: Jef
126151 by: Jason Wong
126152 by: Joakim Andersson
re-writing to the same socket
126144 by: Gareth Thomas
126153 by: Matt Vos
Re: PHP] can't pass complete URL (part of the query string) - aha -- that worked - except for the javascript
126145 by: Nicole Lallande
Newbie: Can't get my PHP server to work
126149 by: Marcos Bastian
Getting the script path of a commandline script
126150 by: Ryan Grove
126158 by: DL Neil
Bug with register_globals on versus 1 and php_value vs php_flag?
126154 by: Daevid Vincent
126159 by: Ford, Mike [LSS]
IE Problems: disappearing text with 'Back' button
126155 by: Andre Dubuc
126165 by: Kevin Stone
126170 by: Andre Dubuc
decimal places
126157 by: Bryan Koschmann - GKT
126161 by: Kevin Stone
126162 by: Van Andel, Robert
126164 by: Matt Vos
126166 by: Bryan Koschmann - GKT
126172 by: John Herren
Upload problem - PC, *nix, and Max EOL characters
126167 by: Lee P. Reilly
126169 by: Matt Vos
126176 by: Lee P. Reilly
126178 by: Lee P. Reilly
126188 by: Matt Vos
126190 by: Lee P. Reilly
GD works - PNG not
126168 by: Frederico Gomes Barbosa
Need email solution
126174 by: Manuel Ochoa
126175 by: Rodney Green
File upload on Win2k ...
126179 by: Rich Gray
126191 by: Rich Gray
Decrypt Password
126180 by: Stephen
126182 by: Chris Boget
126183 by: Tom Woody
126184 by: Jason Wong
126185 by: Stephen
126197 by: empty
php version of majordomo?
126181 by: The Gabster
126186 by: Jason Wong
126192 by: The Gabster
Confirm message box
126189 by: Wilmar Perez
deleting a record.
126194 by: Peter Houchin
126199 by: Kyle Gibson
Problems with a simple While-If condition
126196 by: Rodrigo de Oliveira
URL hiding
126200 by: Kris
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
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
>
>
>
>
>
attached mail follows:
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
attached mail follows:
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?
attached mail follows:
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
>
>
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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
vivekkedia
yahoo.com
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
Please do a quick google search first:
http://www.google.com/search?hl=en&ie=ISO-8859-1&q=storing+images+in+mysql&b tnG=Google+Search
Or at least TRY to find the answer by yourself.
on 26/11/02 11:42 PM, Vivek Kedia (vivekkedia
yahoo.com) 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 --------------------
attached mail follows:
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" <justin
indent.com.au> skrev i meddelandet
news:BA09BAF6.1855B%justin
indent.com.au...
> Please do a quick google search first:
>
>
http://www.google.com/search?hl=en&ie=ISO-8859-1&q=storing+images+in+mysql&b
> tnG=Google+Search
>
> Or at least TRY to find the answer by yourself.
>
>
> on 26/11/02 11:42 PM, Vivek Kedia (vivekkedia
yahoo.com) 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
> --------------------
>
attached mail follows:
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
attached mail follows:
At 13:50 26.11.2002, ed
home.homes2see.com 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/
attached mail follows:
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, ed
home.homes2see.com 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
>
attached mail follows:
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, ed
home.homes2see.com 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
>
>
attached mail follows:
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, ed
home.homes2see.com 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
> >
> >
>
attached mail follows:
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";
}
?>
<ed
home.homes2see.com> wrote in message
news:Pine.LNX.4.04.10211260745120.8696-100000
home.homes2see.com...
>
> 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
>
>
attached mail follows:
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";
}
?>
<ed
home.homes2see.com> wrote in message
news:Pine.LNX.4.04.10211260829030.8867-100000
home.homes2see.com...
>
> 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, ed
home.homes2see.com 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
> > >
> > >
> >
>
attached mail follows:
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";
>
> }
>
> ?>
>
>
>
>
>
> <ed
home.homes2see.com> wrote in message
> news:Pine.LNX.4.04.10211260745120.8696-100000
home.homes2see.com...
> >
> > 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
>
attached mail follows:
--- Ernest E Vogelsinger <ernest
vogelsinger.at> wrote:
> At 13:50 26.11.2002, ed
home.homes2see.com 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
attached mail follows:
On Tuesday 26 November 2002 23:45, Chris Shiflett wrote:
> --- Ernest E Vogelsinger <ernest
vogelsinger.at> wrote:
> > At 13:50 26.11.2002, ed
home.homes2see.com 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. */
attached mail follows:
--- Jason Wong <php-general
gremlins.biz> wrote:
> At 13:50 26.11.2002, ed
home.homes2see.com 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
attached mail follows:
At 16:45 26.11.2002, Chris Shiflett spoke out and said:
--------------------[snip]--------------------
>--- Ernest E Vogelsinger <ernest
vogelsinger.at> wrote:
>
>> At 13:50 26.11.2002, ed
home.homes2see.com 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/
attached mail follows:
--- Ernest E Vogelsinger <ernest
vogelsinger.at> 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
attached mail follows:
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. ***
attached mail follows:
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" <s.garriock
rgc.aberdeen.sch.uk> wrote in message
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. ***
attached mail follows:
>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.
attached mail follows:
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=1&val2=2&val3=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=2&val3=3' portion of the query string )
Any ideas? Sorry if this is obvious - pulling an 'all nighter'...
TIA,
Nicole
-- ######################## Nicole Lallande nicolenmlconsulting.com 760.753.6766 ########################
attached mail follows:
-----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-----
attached mail follows:
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" <ghank
millerdavis.com> 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
>
>
>
>
>
attached mail follows:
"Geoff Hankerson" <ghank
millerdavis.com> 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
attached mail follows:
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 "<td><i>" . $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:copperwalls
hotmail.com]
>
> "Geoff Hankerson" <ghank
millerdavis.com> 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... :)
attached mail follows:
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...
attached mail follows:
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=1&val2=2&val3=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=2&val3=3' portion of the query string )
Any ideas? Sorry if this is obvious - pulling an 'all nighter'...
TIA,
Nicole
-- ######################## Nicole Lallande nicolenmlconsulting.com 760.753.6766 ########################
attached mail follows:
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:nicole
nmlconsulting.com]
> Gesendet: Dienstag, 26. November 2002 15:40
> An: php-general
lists.php.net
> 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=1&val2=2&val3=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=2&val3=3' portion of the query
> string )
>
> Any ideas? Sorry if this is obvious - pulling an 'all nighter'...
>
> TIA,
>
> Nicole
>
> --
> ########################
> Nicole Lallande
> nicole
nmlconsulting.com
> 760.753.6766
> ########################
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
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=1&val2=2&val3=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=2&val3=3' portion of the query > string )
Use
<a href="javascript: openWin('email.php?ref=<?=urlencode($pageURL);?>')">this page</a>
HTH Erwin
attached mail follows:
> 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...
attached mail follows:
> 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...
attached mail follows:
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
attached mail follows:
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
attached mail follows:
Hello,
"Oliver Spiesshofer" <oliver
email.ch> wrote:
> Hi, > > Is it possible to use mbstring after setting the necessary values in > ini_set() or htaccess without having it enabled during /configure?
No.
Well, if you're using windoze, you can probably just do it in your php.ini but it seems like you're not, so...
Anyway,
- E
attached mail follows:
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
attached mail follows:
> 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
attached mail follows:
--- Shane McBride <shane
rditech.net> 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
attached mail follows:
So, you are using a database to store the records?
-----Original Message-----
From: Chris Boget [mailto:chris
wild.net]
Sent: Tuesday, November 26, 2002 10:45 AM
To: Shane McBride; php-general
lists.php.net
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
attached mail follows:
> 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
attached mail follows:
--- Chris Boget <chris
wild.net> 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
attached mail follows:
> > 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
attached mail follows:
"Chris Boget" <chris
wild.net> 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
attached mail follows:
> > 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
attached mail follows:
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
attached mail follows:
Is there an actual way to store the data in a temporary table as you go through the multi-page form and then extract that data from the temporary storage from the DB App and either process the data or store it in a permanent place?
I have never done this before, but maybe someone else has? Any tips on how to do this, what "type(s)" of DB tables are required to do this and can you give me an url to help me research it further?
I think this would be a great alternative to the sessions solution because it doesn't work really well with some PHP error handling that you need to do for the forms. You have to register and unregister variables throughout the form and it gets hard to keep track of when you have so many forms and field variables to deal with. With a temporary DB table, I can just insert any data that has been checked for errors and then not have to worry about passing them back and forth until the end of the application when I actually need to do something with them.
- Nilaab
> -----Original Message-----
> From: Chris Boget [mailto:chris
wild.net]
> Sent: Tuesday, November 26, 2002 10:24 AM
> To:
Edwin; Shane McBride
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Multiple page form
>
>
> > > 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
>
>
attached mail follows:
On Wednesday 27 November 2002 05:11, superbus22
attbi.com wrote:
> Is there an actual way to store the data in a temporary table as you go
> through the multi-page form and then extract that data from the temporary
> storage from the DB App and either process the data or store it in a
> permanent place?
>
> I have never done this before, but maybe someone else has? Any tips on how
> to do this, what "type(s)" of DB tables are required to do this and can you
> give me an url to help me research it further?
Search the documentation of your db of choice for "temporary table"
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Early to rise, early to bed, makes a man healthy, wealthy and dead. -- Terry Pratchett, "The Light Fantastic" */
attached mail follows:
> Is there an actual way to store the data in a temporary table as you go > through the multi-page form and then extract that data from the temporary > storage from the DB App and either process the data or store it in a > permanent place? > > I have never done this before, but maybe someone else has? Any tips on how > to do this, what "type(s)" of DB tables are required to do this and can you > give me an url to help me research it further? > > I think this would be a great alternative to the sessions solution because > it doesn't work really well with some PHP error handling that you need to do > for the forms. You have to register and unregister variables throughout the > form and it gets hard to keep track of when you have so many forms and field > variables to deal with. With a temporary DB table, I can just insert any > data that has been checked for errors and then not have to worry about > passing them back and forth until the end of the application when I actually > need to do something with them.
So don't add it to the session until you've verified the data. It's the same as using a temp table but you don't have to worry about the overhead of the database and you don't have to worry about cleanup with sessions.
Also, a true TEMPORARY table will only be there for the current connection, so on the next page request, the table will be gone.
---John Holmes...
attached mail follows:
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=blah&caption=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.jpg&caption=Some+Text >> >> The problem is obviously (I think) that the $_GET['caption'] is >> failing.
True, if you receive &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 '&'. Is a >> browser doing this?
> Yes it is.
No, it isn't. I sure hope there is no browser which turns & in & in URL's. That would be very, very bad indeed!
> Actually, you should specify the URL with the & > yourself, like this: > > <a HREF="show_pic.php?pic=blah&caption=Some+Text">
Of course not...this is a HREF tag, which can use & instead of &. & 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
attached mail follows:
In an earlier message, Derick Rethans [mailto:derick
php.net] said ...
> Yes it is. Actually, you should specify the URL with the > & yourself, like this:
> <a HREF="show_pic.php?pic=blah&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 '&' -> '&' 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 '&' to separate arguments on the query string, how do they get separated out for access via $_GET?
> --
-- JR
attached mail follows:
Not, this answer makes sense. I couldn't see how using '&' 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:erwin
isiz.com] > Sent: Tuesday, November 26, 2002 10:54 AM > To: php-general
lists.php.net > Subject: [PHP] Re: & 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=blah&caption=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.jpg&caption=Some+Text > >> > >> The problem is obviously (I think) that the $_GET['caption'] is > >> failing. > > True, if you receive &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 '&'. Is a > >> browser doing this? > > > Yes it is. > > No, it isn't. I sure hope there is no browser which turns & in & in > URL's. That would be very, very bad indeed! > > > Actually, you should specify the URL with the & > > yourself, like this: > > > > <a HREF="show_pic.php?pic=blah&caption=Some+Text"> > > Of course not...this is a HREF tag, which can use & instead of > &. & > 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 >
attached mail follows:
> 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
attached mail follows:
Hello,
"Jonathan Rosenberg (Tabby's Place)" <jr
tabbysplace.org> wrote:
[snip] > I'm missing something here. If you use '&' 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 & would be translated to &. (The browser should take care of this since it's the proper way to do it anyway...)
- E
attached mail follows:
--- "Jonathan Rosenberg (Tabby's Place)" <jr
tabbysplace.org> wrote:
> In an earlier message, Derick Rethans [mailto:derick
php.net] said
>
> > Yes it is. Actually, you should specify the URL with the
> > & yourself, like this:
> >
> > <a HREF="show_pic.php?pic=blah&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=blah&caption=Some+Text">
Then your Web browser should interpret the & as an HTML entity and send a GET request (when you click the link) to:
show_pic.php?pic=blah&caption=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 '&' -> '&' 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=blah&caption=Some+Text">
And the browser sends a GET request to:
show_pic.php?pic=blah&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 & in it (which it should not).
> I'm missing something here. If you use '&' to separate > arguments on the query string, how do they get separated out for > access via $_GET?
Because you are writing the & 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
attached mail follows:
At 16:54 26.11.2002, Erwin spoke out and said: --------------------[snip]-------------------- >> Actually, you should specify the URL with the & >> yourself, like this: >> >> <a HREF="show_pic.php?pic=blah&caption=Some+Text"> > >Of course not...this is a HREF tag, which can use & instead of &. & >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 & 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/
attached mail follows:
I tried it & it fails. The browser sends the query string with the & & the $_GET access fails.
I am using IE 6. I can't imagine that it would be buggy in this regard.
-- JR> -----Original Message----- > From:
Edwin [mailto:copperwalls
hotmail.com] > Sent: Tuesday, November 26, 2002 11:17 AM > To: Jonathan Rosenberg (Tabby's Place) > Cc: php-general
lists.php.net > Subject: Re: [PHP] Re: & in Query String > > > Hello, > > "Jonathan Rosenberg (Tabby's Place)" <jr
tabbysplace.org> wrote: > > [snip] > > I'm missing something here. If you use '&' 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 & would be translated to &. (The browser > should take care of this since it's the proper way to do it anyway...) > > - E >
attached mail follows:
Ok ... I take back what I said about & not working in a query string. It works just fine.
But, none of this explains why I am sometimes receiving a request with & in the query string, especially I am using '&' in the <A> link.
The only way I think I can find out is by augmenting the error message I received, as described earlier.
I'll report back when/if I learn anything from doing this.
-- JR> -----Original Message----- > From: Ernest E Vogelsinger [mailto:ernest
vogelsinger.at] > Sent: Tuesday, November 26, 2002 12:15 PM > To: Erwin > Cc: php-general
lists.php.net > Subject: Re: [PHP] Re: & in Query String > > > At 16:54 26.11.2002, Erwin spoke out and said: > --------------------[snip]-------------------- > >> Actually, you should specify the URL with the & > >> yourself, like this: > >> > >> <a HREF="show_pic.php?pic=blah&caption=Some+Text"> > > > >Of course not...this is a HREF tag, which can use & instead of > &. & > >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 & 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/ >
attached mail follows:
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.
simon.taylor
afritol.co.za
attached mail follows:
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
attached mail follows:
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=5&olimit=0&zid=1&lid=1
results in http://mydomain.com/displayem.php3?cat=5 being passed and
the '&olimit=0&zid=1&lid=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:nicole
nmlconsulting.com]
> Gesendet: Dienstag, 26. November 2002 15:40
> An: php-general
lists.php.net
> 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 nicolenmlconsulting.com 760.753.6766 ########################
attached mail follows:
--- Nicole Lallande <nicole
nmlconsulting.com> wrote:
> <a href="email.php?ref=<?=urlencode($pageURL);?>">this page</a> > > where the url is > > http://mydomain.com/displayem.php3?cat=5&olimit=0&zid=1&lid=1 > > results in http://mydomain.com/displayem.php3?cat=5 being passed > and the '&olimit=0&zid=1&lid=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
attached mail follows:
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=5&olimit=0&zid=1&lid=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 <nicole
nmlconsulting.com> wrote:
> <a href="email.php?ref=<?=urlencode($pageURL);?>">this page</a> > > where the url is > > http://mydomain.com/displayem.php3?cat=5&olimit=0&zid=1&lid=1 > > results in http://mydomain.com/displayem.php3?cat=5 being passed > and the '&olimit=0&zid=1&lid=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 nicolenmlconsulting.com 760.753.6766 ########################
attached mail follows:
--- Nicole Lallande <nicole
nmlconsulting.com> wrote:
> <form action="http://embitec.com/fishcart/email.php?ref=http://embitec.com/fishcart/displayem.php3?cat=5&olimit=0&zid=1&lid=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
attached mail follows:
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
attached mail follows:
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 >
attached mail follows:
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 programmersCome visit us at http://www.phparch.com!
attached mail follows:
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
attached mail follows:
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 (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA946yWF9k9BmZXCWYRAolCAKCoDG6NodePSTM1UBY8+/Rgx40xigCgnYAm 2DmIYYUIGy6Ss7H1gXjjw9g= =0c7n -----END PGP SIGNATURE-----
attached mail follows:
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 <rasmus
php.net> 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
attached mail follows:
Usually the best solution is to use whatever backend you are talking to correctly. For a long-running MySQL query, for example, you should have a look at the non-blocking mysql_unbuffered_query() call.
There is a fork() function in the pcntl extension and there is also a very experimental thread extension in PECL, but both of these should be a last resort.
-Rasmus
On Tue, 26 Nov 2002, ROBERT MCPEAK wrote:
> 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 <rasmus
php.net> 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
>
>
attached mail follows:
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
attached mail follows:
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
>
attached mail follows:
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
attached mail follows:
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 programmersCome visit us at http://www.phparch.com!
attached mail follows:
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
--=-55MCx4mKkYtbQGU41izb--
attached mail follows:
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 */
attached mail follows:
> > 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
attached mail follows:
Marco,
Would you have any examples for using an SSH tunnel? I'm using fsockopen to get data from proprietary server software (just returns data to me in different formats) and I would like to have it secure. I'm just not sure how I could incorporate that.
Thanks,
Bryan
On 26 Nov 2002, Marco Tabini wrote:
|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 | |
attached mail follows:
Well, as far as I know you need to have sshd (or an equivalent) running on the receiving end. Then, on your server you call up a command like so:
ssh -f -2 -N -L {source-port}:{end-address}:{end-port} {sshd-server-address} -l {login}
This command causes ssh to create a secure tunnel that goes from source-port on your server to end-address:end-port through the ssh server {sshd-server-address}. Clearly, {sshd-server-address} and {end-address} can be the same computer, but not necessarily--as long as there is a direct route between the two and you can consider that route secure.
Once you've established the connection, you can connect to your local box on the {source-port}, and your data will be transparently (and securely) redirected to the new box.
For example:
ssh -N -2 -f -L 3307:my.mysql.box:3306 my.mysql.box -l mysql_user
creates a secure tunnel for connecting to a remote MySQL server securely. After you've established the connection, you can use 127.0.0.1:3307 on your local box to connect to MySQL and your data will be transported securly to the other computer.
Hope this helps... a more complete (and probably more accurate) explanation would take a long time, but if you look around on the Net you should find plenty of resources.
Cheers,
Marco
-- ------------ php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmersCome visit us at http://www.phparch.com!
attached mail follows:
Marco,
Would you have any examples for using an SSH tunnel? I'm using fsockopen to get data from proprietary server software (just returns data to me in different formats) and I would like to have it secure. I'm just not sure how I could incorporate that.
Thanks,
Bryan
On 26 Nov 2002, Marco Tabini wrote:
|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 | |
attached mail follows:
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=5&olimit=0&zid=1&lid=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=5&olimit=0&zid=1&lid=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 nicolenmlconsulting.com 760.753.6766 ########################
attached mail follows:
--- Nicole Lallande <nicole
nmlconsulting.com> 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=5&olimit=0&zid=1&lid=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
attached mail follows:
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.
manh
bgai.com
attached mail follows:
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 ***********************
attached mail follows:
> 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
attached mail follows:
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 th