php-general Digest 1 Apr 2001 21:37:24 -0000 Issue 602

Topics (messages 46500 through 46525):

Re: login without database
        46500 by: Erick Papadakis

Re: "\r\n" gives extra empty line between each line in Outlook
        46501 by: Erick Papadakis

Re: Compiling PHP4, & Re: Image resizing
        46502 by: Daniel B I

<$B%9%H%l%92r>C(B>
        46503 by: fun.juno.ocn.ne.jp

Execute Shell command?
        46504 by: KPortsmout.aol.com
        46510 by: Steve Werby

Database connections
        46505 by: David Hynes

Re: PHP SITE SUGGESTION
        46506 by: Joe Stump

Re: Can a WHILE be done inside an array?
        46507 by: Reuben D Budiardja

known problems with session_register()?
        46508 by: Felix Kronlage

Finally!  Got PHP to work with RH7 and Oracle
        46509 by: Jon Jacob

How to send a mail in html format
        46511 by: Jan Grafström
        46525 by: David Pieper

setcookie().. how to retrieve data afterward?
        46512 by: Andrew Rose
        46514 by: Jack Sasportas
        46521 by: Andrew Rose

Re: Php with Frames
        46513 by: Lindsay Adams

Inserting into the middle of an array
        46515 by: Yoshi Melrose
        46516 by: Lindsay Adams
        46519 by: Yoshi Melrose
        46520 by: Lindsay Adams

Re: data entry validation
        46517 by: Manuel Lemos

Re: PHP as a general scripting language?
        46518 by: Manuel Lemos

ZEND Encoder
        46522 by: KPortsmout.aol.com
        46523 by: Michael Kimsal
        46524 by: James Moore

Administrivia:

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

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

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


----------------------------------------------------------------------


Does this work on Windows machines?  WHat is the $PHP_AUTH_USER and where
does it come from? What should my access.inc.php look like? I saw the
PHP_AUTH_USER on the www.php.net website but looks like it is only possible
on PHP module, not pHP CGI?

Thanks in advance




-----
"Romeo Manzur" <[EMAIL PROTECTED]> wrote:

> require('acces.inc.php');
> if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $st_LOGIN) && (
> $PHP_AUTH_PW == "$st_PASSWORD" )) ) {
>   header("WWW-Authenticate: Basic entrer=\"Admin Basta\"");
>   header("HTTP/1.0 401 Unauthorized");
>   echo "Access in-autorizado...";
>   exit;
> }
>
> where access.inc.php has the variables $st_LOGIN and st_PASSWORDS for
> authenticate you login, you have to put this code before the <html> tag...
> luck...



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01






I am not sure what you want to do, but you could try this:

    $myText = nl2br($dataFromSubmittedTextBox);


Then $myText will have the correct values.

Cheers


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01






Hey, man, you dont look at this list too often, isnt it?
Some days ago I wrote about this.
Here is the message one more time:

You need the jpeg support. Shortly, do this:
(I will use my version names, so you can easyly
find something, if you find newer ones, it's your bussiness)

1. search the internet for: 
jpegsrc.v6b.tar.gz 
gd-1.8.3.tar.gz
apache_1.3.14.tar.gz
php-4.0.4.tar.gz

2. unzip all files in a tmp directory (let's say /tmp ):
tar zxvf jpegsrc.v6b.tar.gz 
the same for gd, php, apache...

3. modify the 'Makefile' of the jpeg kit, to meet your requirements
(only the paths to be correct, as your are)
then issue: 
 ./configure --enable-shared --enable-static
then
 make 
 make install

4. modify the gd Makefile:
put there the your paths and uncomment the 'CFLAGS' line that 
enables the jpeg support (something like CFLAGS -DHAVE jpeg)
then issue:
 make
 make install

5. now configure php and apache and compile them. it should work.
it took me alot these days to discover all of this..

I hope it helps.








$B!z!z!z!z!z!z!z!!(BJust in Mail $B!z!z!z!z!z!z!z(B $B>pJsDs6!4k6HL>(B Fun! Fun!! Fun!!! $B"!!~"!!~"!!~"!!~"!!~"!!~"!!~"!!~"!!~"!!~"!!~"!!~"!(B $B!!(B $B:#=5$N$*>)$a%5%$%H$r$*CN$i$;$$$?$7$^$9(B $B!!(B http://sv.g-spot.to/check/mail.html $B!!(B $B!!!!!#(B $B!z!z!z!z!z!z!z!!(BJust in Mail $B!z!z!z!z!z!z!z(B



Hi,

Does anyone know if there is a way to execute a shell command in a php 
script? I am trying to execute the following:

/usr/sbin/cadduser -d www.domain.com -f Adrian -u testing -p testing -q 10 -w 
[EMAIL PROTECTED]

I have tried passthru(), system(), exec() and none seem to work. I also tried 
the backtick and that never worked. Any ideas anyone?

Adrian




<[EMAIL PROTECTED]> wrote:
> Does anyone know if there is a way to execute a shell command in a php
> script? I am trying to execute the following:
>
> /usr/sbin/cadduser -d www.domain.com -f Adrian -u testing -p testing -q
10 -w
> [EMAIL PROTECTED]

If you're running an Apache module version of PHP, the program you are
trying to execute will have to be owned by the same owner as Apache and user
executable (chmod u+x cadduser) or world executable (chmod o+x cadduser)
which is not good from a security standpoint.  I'm not certain, but cadduser
seems like the name of a script to add a user to Linux from the Cobalt
RaQ3/4 shell tool package so you're probably running PHP as an Apache
module.  The alternative is to install a second copy of PHP as a CGI, in
which case each PHP script runs as the owner of that script.  So if an
external program is owned by root, your PHP script can run it through a
shell command by making your PHP script owned by root.

Hopefully that will help you get closer to a solution.  If not, you'll
probably get better assistance if you post the answers to the following
questions:

What operating system, who owns the script and what are the permissions on
it?  Is PHP running as an Apache module or as a CGI?  If it's an Apache
module, what owner does Apache runs as?

Also, if your system is a Cobalt RaQ you may want to post to the
cobalt-users mailing list
(http://list.cobalt.com/mailman/listinfo/cobalt-users/) to signup.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/





I'm using PHP on a windows box to access a MySQL database.

I noticed that I do not need to open a database connection before performing
a mysql_db_query().  Is this bad coding ?  Should the database connection
always be made ?  Is this specific to Windows ?

# $databaseConnection = mysql_connect ("localhost", "", "");  ## I don't
seem to need this line, or the last one
mysql_db_query("dbnam", "SQL query");
# mysql_close ($databaseConnection);

Thanks,
David.

-----------------------
Fed202 Solutions
www.fed202solutions.com
Mobile : 07779 293368
-----------------------





wget works fine with redirects, etc. I've never had any problems downloading
php with wget (even on the new site).

--Joe

On Fri, Mar 30, 2001 at 10:40:50AM -0500, Michael Kimsal wrote:
> With the hope that someone at php.net is listening...
> 
> I understand you want to track how many downloads you've got, etc. but
> can you make the download more direct somehow?  I can't do a wget
> against
> the php.net site to download the latest version.  :(  I think it's the ?
> in the
> URL that gives me a problem.
> 
> Thanks.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


/******************************************************************************\
 *                    Joe Stump - PHP/SQL/HTML Developer                      *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\******************************************************************************/




Builld the string in a variables by concatenating them (using while), and 
then put the string in the array. It should be something like this:

while($modyear <= $curyear)
   {
   echo "<option>".$modyear.;
   $options = $options . "<option>$modyear" ;
   $modyear++;
   }

And then in the array, do:

$make = array('Make','12','keyword','1:30','select', $temp_option ,'text');

Hope that helps.
Reuben D. Budiardja

At 06:35 PM 3/31/01 -0600, Kenneth R Zink II wrote:
>I'm trying to figure out how to do a WHILE inside of an array.
>
>Here is the while statement.
>
>$modyear = "1982";
>$curyear = date("Y");
>$curyear = $curyear + 1;
>
>while($modyear <= $curyear){
>echo "<option>".$modyear.;
>$modyear++;
>}
>
>The array I want to use the WHILE in, looks like this.  The X is where I
>want to insert the WHILE.
>
>'year' => array('Year','12','keyword','1:30','select','X','text'),
>
>Here is what a functioning array statment in my script looks like for
>referance.
>
>'make' =>
>array('Make','12','keyword','1:30','select','<option>Chevrolet<option>GMC<op
>tion>Isuzu<option>Oldsmobile','text'),
>
>Can someone please give me some pointers. =)
>
>Thanks.
>
>
>Kenneth R Zink II     [EMAIL PROTECTED]    ICQ# 5095094
>'87 GMC S-15 Ext. Cab (Hurricane) ...BBC 524 being built !!!
>http://www.s-series.org/htm/windstorm/project-windstorm.htm
>'85 Chevy S-10 Blazer (FireStorm) ...Soon to be 3.4L SFI !!!
>http://www.s-series.org/htm/firestorm/firestorm.htm
>'84 Oldsmobile Delta 88 Delta 88 Royal Brougham.
>Racing by the grace of God!!!
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reuben D. Budiardja
Web Database Application Programmer / Analyst
Devcorps, ITS
Goshen College, IN 46526





Hi,

are there any knows problems/bugs with session_register()?

With openbsd  as a platform (not tested on others) I have the problem 
that 20% of the times sessions don't get initialized correctly.
The session-file is created in /tmp (cookies for session-use are turned off), 
just the variables registered via session_registered are not written into the file. 
The same piece of code works on the same box, with same php 80% of the times.
(Had this problem with php4.0.4x up to php4.0.5rc3).

any hints on this?
-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 





Well, my bumbling determinism finally paid off.

After starting at the configuration laid down by the rpms, I could not
figure out what was wrong, so I decided to recompile the php source with
the OCI8 option (and -enable-sigchild which is advised in the
configuration output) and for whatever reason, it works.

Go figure.

I believe the bug lies in the OCI rpm but that is just a guess.

Thanks for all of you who tried to help.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





Hi!
Can I add something in this string to get a htmlpage sent as mail?

mail($recipient,$subject,$corps,"From:
$admail\nReply-To:$admail\nX-Mailer: PHP/");
Thanks in advance.

Regards
Jan





Jan Grafström wrote:
> 
> Hi!
> Can I add something in this string to get a htmlpage sent as mail?
> 
> mail($recipient,$subject,$corps,"From:
> $admail\nReply-To:$admail\nX-Mailer: PHP/");
> Thanks in advance.
> 
> Regards
> Jan
> 

Content-Type: text/html

Enjoy,
David Pieper

-- 
programmer n. /pro gram er/ A device for transmuting caffeine into code.




Ive been playing with setcookie() and am stuck with trying to re-pull the
infomation I set,  I use:

 setcookie ("user_id", $userid, 1, "", "", 1);

 to set the cookie and:

if(isset( $user_id )){
 echo " cookie 'user_id': $user_id\n";
} else

 echo" no cookie set ...\n";
}

to see if its there.. now this is the closest Ive seen anyone else do it and
to me it dosnt make much sense at all the code for retrieving.. also it
dosnt work.. suprise suprise.. so anyone know how to do this?

thanks in advance

-Andrew Rose






If you just echo $userid you will get the results.

do this
setcookie ("cookie_variable", "chocalate chip", 1, "", "", 1);

echo $cookie_variable

You can name the cookie_variable whatever you want and that will be referenced
as the variable to store "chocalate chip".
Now if you want to see the value from within a function you will need to also do
this:

 global $HTTP_COOKIE_VARS;

this will enable you to see the values stored in the cookies.

Andrew Rose wrote:

> Ive been playing with setcookie() and am stuck with trying to re-pull the
> infomation I set,  I use:
>
>  setcookie ("user_id", $userid, 1, "", "", 1);
>
>  to set the cookie and:
>
> if(isset( $user_id )){
>  echo " cookie 'user_id': $user_id\n";
> } else
>
>  echo" no cookie set ...\n";
> }
>
> to see if its there.. now this is the closest Ive seen anyone else do it and
> to me it dosnt make much sense at all the code for retrieving.. also it
> dosnt work.. suprise suprise.. so anyone know how to do this?
>
> thanks in advance
>
> -Andrew Rose
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
___________________________________________________________
Jack Sasportas
Innovative Internet Solutions
Phone 305.665.2500
Fax 305.665.2551
www.innovativeinternet.com
www.web56.net






cheers Jack but Ive tried this and get the error msg:

Warning: Undefined variable: user_id in
C:/XITAMI/webpages/netrux/intothemain.php on line 14

so its not setting the varible by the looks of it.... any ideas? cheers

Jack Sasportas wrote in message
<[EMAIL PROTECTED]>...
>If you just echo $userid you will get the results.
>
>do this
>setcookie ("cookie_variable", "chocalate chip", 1, "", "", 1);
>
>echo $cookie_variable
>
>You can name the cookie_variable whatever you want and that will be
referenced
>as the variable to store "chocalate chip".
>Now if you want to see the value from within a function you will need to
also do
>this:
>
> global $HTTP_COOKIE_VARS;
>
>this will enable you to see the values stored in the cookies.
>
>Andrew Rose wrote:
>
>> Ive been playing with setcookie() and am stuck with trying to re-pull the
>> infomation I set,  I use:
>>
>>  setcookie ("user_id", $userid, 1, "", "", 1);
>>
>>  to set the cookie and:
>>
>> if(isset( $user_id )){
>>  echo " cookie 'user_id': $user_id\n";
>> } else
>>
>>  echo" no cookie set ...\n";
>> }
>>
>> to see if its there.. now this is the closest Ive seen anyone else do it
and
>> to me it dosnt make much sense at all the code for retrieving.. also it
>> dosnt work.. suprise suprise.. so anyone know how to do this?
>>
>> thanks in advance
>>
>> -Andrew Rose
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>--
>___________________________________________________________
>Jack Sasportas
>Innovative Internet Solutions
>Phone 305.665.2500
>Fax 305.665.2551
>www.innovativeinternet.com
>www.web56.net
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






The <form> tag can tag a TARGET attribute, just like the <A> tag can.

<FORM Action="myscript.php" METHOD="POST" TARGET="Bottom_Frame">

Adjust to match your script and frame names

On 4/1/01 2:30 AM, "Diego Pérez Rández" <[EMAIL PROTECTED]> wrote:

> 
>   Hi to all:
> 
>   I have a page with two frames. In the top frame I have a form where
> I can select some options. When I press the send button a php program
> generate a html page that I want to show in the Botton frame. I don't
> know how I can load the new page generate in the botton frame. I only
> want to change the botton frame not the top.
> 
>   Probably its easy to do.
> 
>   Can someone help me?
> 
>   Thanks.
> 
> 
>   Best regards, Diego
> 





Ok. I must be soooo blind. Is there a function to insert a value into the
middle of an array without rewriting it?






On 4/1/01 11:32 AM, "Yoshi Melrose" <[EMAIL PROTECTED]> wrote:

> Ok. I must be soooo blind. Is there a function to insert a value into the
> middle of an array without rewriting it?
> 
> 
In PHP3, no.
PHP4, see http://www.php.net/manual/en/function.array.php

You could pull it off with combinations of array_slice, array_splice,
array_merge, array_push...

Lots of array functions in php4. 





----- Original Message -----
From: "Lindsay Adams" <[EMAIL PROTECTED]>
> On 4/1/01 11:32 AM, "Yoshi Melrose" <[EMAIL PROTECTED]> wrote:
>
> > Ok. I must be soooo blind. Is there a function to insert a value into
the
> > middle of an array without rewriting it?
> >
> >
> In PHP3, no.
> PHP4, see http://www.php.net/manual/en/function.array.php
>
> You could pull it off with combinations of array_slice, array_splice,
> array_merge, array_push...
>
> Lots of array functions in php4.
>

Okay. that's what I was afraid of. I was kinda hoping for an array_insert()
function. =)







On 4/1/01 11:57 AM, "Yoshi Melrose" <[EMAIL PROTECTED]> wrote:

> ----- Original Message -----
> From: "Lindsay Adams" <[EMAIL PROTECTED]>
>> On 4/1/01 11:32 AM, "Yoshi Melrose" <[EMAIL PROTECTED]> wrote:
>> 
>>> Ok. I must be soooo blind. Is there a function to insert a value into
> the
>>> middle of an array without rewriting it?
>>> 
>>> 
>> In PHP3, no.
>> PHP4, see http://www.php.net/manual/en/function.array.php
>> 
>> You could pull it off with combinations of array_slice, array_splice,
>> array_merge, array_push...
>> 
>> Lots of array functions in php4.
>> 
> 
> Okay. that's what I was afraid of. I was kinda hoping for an array_insert()
> function. =)
> 
> 
> 
Hmm, just looked at the phpclasses website that is listed at the bottom of
Manuel Lemos' posts, and found this:
http://phpclasses.UpperDesign.com/browse.html/package/109

It is a php class that allows you to insert data into any position.
That will take some of the work off your shoulders :)





Hello Chris,

On 27-Mar-01 19:26:19, you wrote:

>I'm working with some forms that need the data validated.  Dates, times etc.

>my question is, how do I "reset" the form back to the original screen with
>variables  intact so they can make the changes?

It's better that you use the same script to display, validate and process the form.


>is there a code snippet some place i can work with?

You may want to look here at this PHP Form generation and validation class:

http://phpclasses.UpperDesign.com/browse.html/package/1

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--





Hello Gildas,

On 27-Mar-01 05:56:06, you wrote:

>What are the pros and cons to using PHP as a scripting language like Perl or
>Python?

PHP does not support multi-threading.  It's not important for serving Web
pages, but it is very important when you use it for executing tasks that
have to handle with many sources of input, like GUI apoplications, Network
applications, etc..


>Before going too far, I would like to know what other PHP users/gurus think
>about using PHP as a general scripting language, what should be avoided and
>what are the drawbacks I should take care of. Before someone ask me why not
>use Perl or Python: I don't like Perl, I prefer Python, I use it too but I'm
>not as easy with it as I am with PHP and I'd prefer put all my efforts in a
>single language if it can bring me all I expect...

Right, use it at will.  Most people is more confortable with programming
with only one language at a time.  I use only PHP to either setup or serve
my Web applications.  PHP can now be used to manage GUI applications.  I
have written a large meta-programming compiler in PHP.  All that requires
PHP to be run and standalone executable from the shell.  Despite the lack
of multi-threading, PHP is pretty capable and adequate for those purposes.


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--





Hi,

I`m about to buy the Zend encoder from thier website and thought I better ask 
a pretty important question, unfortunately Zend couldn`t be bothered to 
follow up the lead on someone who might buy thier product so I thought I 
would turn to you guys to see if any of you know.

Is it possible in any instance that someone else will be able to de-code my 
PHP scripts once I have used the Zend Encoder on it, and be able to read it? 
Obviously they will be able to decode it to actually use it on the server, 
but will they ever be able to read the source?

Thanks
Adrian




Without getting into the specifics of the zend product,
which we've not tested thoroughly, I'd hazard a wild speculation that
zend encoder-encoded scripts:

1. can be decoded
2. can NOT be decoded to the original source

Obviously anything encoded needs to be decoded to run, and someone
with enough time on their hands will be able to decode it to the point where
they can understand what's going on at a low level, including any algorithms
you've developed.  If the machine has to be able to run the commands, some
one else can eventually figure out what the machine will be doing.  That's
just a given.  How difficult it would be would be another question,
and my guess is it's not a trivial task, at least to casual users.

Is it going to be decodeable to the original source code?  I *highly* doubt it-
it would be pretty inefficient to encode all your whitespace, comments, etc.

Again, this isn't based on hands-on zend encoder experience, but experience with
other compilers, Java, the APC cache product, and other similar ideas
over the years.



[EMAIL PROTECTED] wrote:

> Hi,
>
> I`m about to buy the Zend encoder from thier website and thought I better ask
> a pretty important question, unfortunately Zend couldn`t be bothered to
> follow up the lead on someone who might buy thier product so I thought I
> would turn to you guys to see if any of you know.
>
> Is it possible in any instance that someone else will be able to de-code my
> PHP scripts once I have used the Zend Encoder on it, and be able to read it?
> Obviously they will be able to decode it to actually use it on the server,
> but will they ever be able to read the source?






> Is it possible in any instance that someone else will be able to
> de-code my
> PHP scripts once I have used the Zend Encoder on it, and be able
> to read it?
> Obviously they will be able to decode it to actually use it on
> the server,
> but will they ever be able to read the source?

They will not be able to read the source as such. If they did mange to
decode your script, which is unlikley then they would have Zend opcode
rather than PHP Source Code which is the PHP equivilent of ASM. It would be
very difficult to reconstuct your source code from this opcode and probably
more hassle than actually rewriting the same functionality themselves (IE
thats a no its pretty much impossible to retrive source code from encoded
files).

James
--
James Moore
[EMAIL PROTECTED]
PHP Web Scripting: http://www.php.net/
PHP QA Team: http://qa.php.net/
PHP-GTK: http://gtk.php.net/
VL-SRM: http://www.vl-srm.net/



Reply via email to