Re: Clearing pipe stream and a few other issues.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Permissions on a virtual server is the reason for running this script as a
cgi. It's not what prefer to do. However, this is only way php will work
under my user name. Perl would probably be a better alternative but I don't
know perl. If I had control of the apache server this would not be a
problem.

I have the script working, I just need to clear up these issues.

Zed

----- Original Message ----- 
From: "Chris" <dmagick@xxxxxxxxx>
To: "zedleon" <support@xxxxxxxxxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Thursday, February 16, 2006 8:27 PM
Subject: Re:  Clearing pipe stream and a few other issues.


>
> > <?
> >
> > $fp=popen("cat","r");
> > $str=fgets($fp);
> > pclose($fp);
> >
> > print $str;
> >
> > $arr = array();
> > foreach (explode('&', $str) as $v) {
> > $split = explode('=', $v);
> > // urldecode content for readability
> > $arr[$split[0]] = urldecode($split[1]); // create assoc. array
> > ${$split[0]} = urldecode($split[1]); // form the variables
> > }
> >
> > //echo $sender_name . '<br/>' . $arr['sender_name'];
> > print_r($arr);
> >
> > $msg = "Sender's Full Name: $sender_name\n";
> > $msg .= "Sender's E-Mail: $sender_email\n";
> > $msg .= "Secret Message? $sender_msg\n\n";
> > ?>
> >
>
> What exactly are you trying to achieve and what problems were you having
> using it as a normal script?
>
>
> I'm guessing it's some form of a mailing script.
>
> What's wrong with using a regular php script with a mail command:
>
> <?php
> $sender_name = htmlentities($_POST['sender_name']);
> $sender_email = htmlentities($_POST['sender_email']);
> $sender_msg = htmlentities($_POST['sender_msg']);
>
> $msg = "Name: $sender_name\n";
> $msg .= "Email: $sender_email\n";
> $msg .= "Message: $sender_msg\n";
>
> mail('........');
> ?>
>
>
> and then your form posts to this script (change the form action to point
> to this new file)...
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux