RE: [PHP] Agh! Driving me crazy!

2003-06-18 Thread Michael Sweeney
Also, you might have problems with the array reference $place[1] not
expanding from within the string - you might need to concatenate the
string around it:

...'$cases', '". $place[1] ."', '$iice'...

..michael..

On Wed, 2003-06-18 at 12:05, Jennifer Goodie wrote:
> You are missing the closing ) around the values you are inserting.
> 
> > Anyone see anything wrong with this line of code?
> >
> > $fine = mysql_query("INSERT INTO
> > tblPOItems(poID,poItemUPC,poItemNumber,poItemDescription,poItemInn
> > erCasePkg,
> > poInnerQuantity,poItemEstQuantity,poItemCostEach,poItemSuggestedSellPrice)
> > values('$poID', '$place[0]', '$inmb', '$ides', '$iicp', '$cases',
> > '$place[1]', '$iice', '$isgs'");
> >
> > I keep getting:
> >
> > Query failed: You have an error in your SQL syntax near '' at line 1 Query
> > was: 1064 exiting.
> >
-- 
Michael Sweeney <[EMAIL PROTECTED]>
Verisity Design, Inc


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



Re: [PHP] easy conversion to a date?

2003-05-30 Thread Michael Sweeney
Look at http://www.php.net/strtotime

..micahel..

On Thu, 2003-05-29 at 09:21, Anthony wrote:
> I have a form where the user enters a date into a text input field.  I need
> to convert this text to a date and put it in a field in a mySQL database.
> Is there an easy way to do this?  Do I have to tear the string appart and
> create a date out of the parts?  Someone must have a fiunction that will do
> this work already right?
> 



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



RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Michael Sweeney
Joe, 

I mostly agree with your opinion. But remember that a method in an
object that has output doesn't have to print the output - it can return
it instead and the calling function can then either display the output
or do something else with it. And if it makes sense to have a method
return HTML, another developer can override that method so that it
returns XML. Or yet another method could take the HTML output of the
first one and convert it to PDF. 

The question, I think, is about figuring out the most effective place to
do what solves the problems. I'm afraid that saying "You should never
ever ever write an OOP method that has HTML in it's output" is so rigid
that it might make the development process more difficult and complex
than it needs to be.

Michael

On Thu, 2003-05-29 at 11:28, Joe Stump wrote:
> Sure ...
> 
> I'm of the belief that OOP (in PHP anyways) has great use for core
> libraries. Core libraries, by their nature, generally don't output HTML.
> It's a core libraries job to separate logic and presentation. How portable
> is your library that outputs HTML for a guy who wants PDF/WAP/XML output?
> 
> For instance, I have a product class that does various things to format
> product *data* prior to my procedural scripts putting it into my Smarty
> templates. If that product class outputted the data in HTML it would be
> useless to me for WAP users or a script that generated PDF versions of our
> online catalog.
> 
> --Joe
> 

> 
> -Original Message-
> From: Johnson, Kirk [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 29, 2003 8:21 AM
> To: 'Joe Stump'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: PHP OOP x Procedural Performance
> 
> 
> > One thing I'd like to abundantly point out is that NOT
> > EVERYTHING BELONGS IN
> > OOP! For instance, if you're building classes that output
> > HTML - you've
> > skipped a few chapters in your OOP design books.
> 
> Joe,
> 
> I am curious about this opinion, could you elaborate a bit, please? I am not
> an OOP programmer, and I'm just interested in your thoughts on this, if you
> have time.
> 
> Kirk



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



Re: [PHP] Isset

2003-03-21 Thread Michael Sweeney
It depends on what you're trying to test.

If you want to find out if a variable is explicitly set to an empty
string, then isset() is not your answer. If you want find out if a
variable exists or is set to a non-null value, isset() will work.
However, it is not always going to give you the results you want in
checking submitted variables from a web page. For instance if an input
variable is set in the form with a value of "", isset() on that variable
will return true, even if it is empty. So if you testing for a value
being submitted, you'll get erroneous results. I've found empty() to be
a better test in  many cases than isset(), but it depends on what you're
trying to test. 

..michael..


On Fri, 2003-03-21 at 11:09, Liam Gibbs wrote:
> Responding to myself:
> 
> < 
> Often, I may have a 0 as values. While $ != "" doesn't recognize 0s (as in,
> that if would be false), isset() seems to work. Should I change all my $ !=
> "" to isset()s, or are there other factors I should check?>>
> 
> Conversely, what about empty(). Is that a better test for if a value could
> be 0 or 1 or 2 or ABC?
-- 
Michael Sweeney <[EMAIL PROTECTED]>
Verisity Design, Inc


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



Re: [PHP] Select value for driopdown box

2003-01-22 Thread Michael Sweeney
Assuming that you know which state is selected before you build the
select list:

$sel_state = $_REQUEST['state'];

...

while($row = mysql_fetch_array($result)) {
$buyerid = $row['buyerid'];
$state = $row['state'];
$selected = $state == $sel_state ? "selected=\"selected\"" : "";

$option_block .= "".
 "$state\n";
}

That will put the string "selected=\"selected\"" (xhtml compliant) into
the option statement for the state that was selected.

..michael..

On Wed, 2003-01-22 at 10:14, Ben C. wrote:
> I am using the query below to edit a record. I want to edit the field which has a 
>list of states in a dropdown box.   I want to have the state that is in the selected 
>field shown as the selected state.  How would I do this?
> 
> 
> Query
> -
>  $sql = "SELECT *
>   FROM $table_name
>   WHERE buyerid = \"$buyerid\"
>   ";
> 
> $result = @mysql_query($sql,$connection) or die(mysql_error());
> 
>   
> while ($row = mysql_fetch_array($result)) {
>  $buyerid = $row['buyerid'];
>  $state = $row['state'];
> 
>   $option_block .= "$state";
> }
> 
> $display_block = "
> 
> 
> $option_block
> 
> ?>
> 
> 
> State
> 
> 
>  
> 
-- 
Michael Sweeney <[EMAIL PROTECTED]>
Verisity Design, Inc


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




Re: [PHP] Looking for advice on a non-profit site development

2003-01-13 Thread Michael Sweeney
Check out phpnuke.org - content management system that seems to answer
most of the criteria you've set out here.

..michael..

On Mon, 2003-01-13 at 13:46, White Wolf wrote:
> Hi All,
> 
> I am a C++ guy, who plans to do a site about C++ Idioms.  I would like to
> make it into a community site with interactivity.  I have concluded that
> PHP would be the right way to go.  However I am "lazy".  I would like first
> to be able to start doing the site using some sort of visual environment
> where I can concentrate mostly on the site and on the possible minimum on
> PHP itself.
> 
> What I am thinking of is a well searchable knowledge base with articles,
> which has a structure (let's say some standard sections).  I plan to make
> it possible to comment on the different articles/its sections just like it
> can be done on the php.net site for the documentation.
> 
> For that kind of site I am looking for a sort of visual design environment,
> preferably free (since it is non-profit) and preferably something for which
> I do not need my own server.
> 
> If you have any hints how should I start, what should I use, please let me
> know!
> 
> Ps: I am not looking for a way of not knowing PHP and use it: but I am
> looking for a way to create a site ASAP, since I believe that what I plan
> to do serves a need.
> 
> 


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




Re: [PHP] Double entry into MySQL..

2003-01-07 Thread Michael Sweeney
There's nothing in your posted code that could cause two inserts into
mysql. The only thing I can think of is that somehow, your script is
getting executed twice. Is there any way that could be happening?

..michael..

On Mon, 2003-01-06 at 16:03, Altug Sahin wrote:
> Hi here,
> 
> I am sending a file to user's browser and logging the downloaded file into
> MySQL but everytime this script works, I see double entry in the MySQL
> table... Why is this happening?
> 
> Any ideas?
> 
> Thanks
> 
>   $today = date("Y-m-d");
> 
>  $conn = db_connect();
> 
>  if(!$conn)
>   echo "Can't connect to database...";
> 
>  $query = "INSERT INTO track_dl (dldate, email, file)
> VALUES ('$today', '[EMAIL PROTECTED]', 'file.ext')";
> 
>  $result = mysql_query($query);
> 
>  if(!$result)
>   echo "Can't execute query: " . mysql_error();
> 
> header("Content-type: application/pdf");
> readfile("file.pdf");
> exit();
> ?>
-- 
Michael Sweeney <[EMAIL PROTECTED]>
Verisity Design, Inc


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




Re: [PHP] Text editors

2003-01-07 Thread Michael Sweeney
jEdit. www.jedit.org.

On Tue, 2003-01-07 at 01:59, Karl James wrote:
> Hello guys,
> Right now im using dreamweaver mx 
>  
> I was wondering if anyone knew of any good free text editors that has
> line counts
> And is good for php….
>  
> 


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




Re: [PHP] libcrypt.a and solaris 8

2002-12-20 Thread Michael Sweeney
I've recently compiled PHP (4.2.3) with openssl support on a Solaris 8
system. openssl does not have a libcrypt.a library - it does have
libcrypto.a. How did you install openssl and what is your configuration
line for PHP? I've found it to be best to configure openssl so that it
installs somewhere like /usr/local/ssl and to configure php to look at
that directory for the openssl linking. It might also help if you told
us what error message you're getting.

..michael..

On Fri, 2002-12-20 at 06:21, dweise wrote:
> hello,
>i'm trying to compile php with openssl and ldap. i can't i keep getting 
> an error. i surfed the web and found a reference that the library 
> libcrypt.a in openssl is not compatable with that in solaris 8. is this true?
> 
> 
> 


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




Re: [PHP] Error installing

2002-12-20 Thread Michael Sweeney
If you are trying to load a PHP-Nuke site, your problem is that the page
can't access your mysql server. Either the server is not running, or the
hostname/username/password is not correct so the program is unable to
successfully connect to the mysql server.

..michael..

On Fri, 2002-12-20 at 01:08, Jason Wong wrote:
> On Thursday 19 December 2002 23:48, Mako Shark wrote:
> > Anybody have any bright ideas?
> >
> > Trying to install my own PHP on my own server. I'm
> > getting the error "Redirection limit for this URL
> > exceeded. Unable to load the requested page."
> 
> 


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




Re: [PHP] preg_match()

2002-12-02 Thread Michael Sweeney
Why not use split() (http://www.php.net/split) or explode() instead of
matching?

..michael..

On Mon, 2002-12-02 at 09:34, Sturle wrote:
> Hello
> 
> I have one coloumn with lots of e-mail adress like this:
> 
> [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED]
> [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
> And i want to take the first row and put the adresses into an array, then
> the second row...
> 
> I try like this, but i don't know what i can write in preg_match() to only
> get the email adress.
> 
> while(odbc_fetch_row($ret)){
> $Epost = odbc_result($ret,"Epost");
> preg_match_all( '/?/', $Epost, $result);
>     foreach ($result[0] as $loop_result)
> 
> 
> 
> 
> sturle
> 
-- 
Michael Sweeney <[EMAIL PROTECTED]>
Verisity Design, Inc


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




Re: [PHP] Set Variable to Multiple Lines

2002-08-29 Thread Michael Sweeney

What you're looking for seems to be called the 'here document' syntax.
I've always seen it used with print and there's a reference to it in the
print function (okay, construct) PHP documentation, but a quick test
shows that you can also use it to assign to variables. As follows:

$var = << 
> I've been searching for this old php feature (perhaps it was
> deprecated), and can't get the right keywords to look it up.
> 
> There was a way, similar to the perl method shown below, to set multiple
> lines of data equal to a variable.
> 
> (in perl)
> $variable = __SOME_HEADER_HERE__
> 
> Put whatever is desired here, including $variables.
> 
> Just end it with this:
> 
> __SOME_HEADER_HERE__;
> 
> 
> Anyone know what this is for PHP?
> 
> Best wishes
> 
> Michael Richardson
> Web Developer
> (520) 529-2000
> [EMAIL PROTECTED]
> 
> 
> //   http://www.mdausa.org   //
> 
> 
> ..very few phenomena can pull someone out 
> of Deep Hack Mode, with two noted exceptions: 
> being struck by lightning, or worse, your *computer*
> being struck by lightning.
> -- Matt Welsh
> 



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




Re: [PHP] Undefined index error

2002-08-19 Thread Michael Sweeney

If you try to access a form variable that hasn't been set, you get an
undefined index. Try checking with something like 
if(isset($_POST['SortBy'])) {
   // do something with 'SortBy'
}

In any case, you'll get the undefined index warning anytime you try to
read an array index that hasn't been set.

..michael..

On Mon, 2002-08-19 at 14:49, Shu Chow wrote:
> I'm using the superglobal $_POST array to access URL 
> parameters passed to my page. I was getting undefined 
> constant errors in my error_log file, and found that I 
> needed to quote the variables in the array. 
>   $_POST['SortBy'] etc. Now, it appears that I've just 
> traded the undefined constant errors for undefined index 
> warnings. Everytime a page hits a page with url 
> parameters, it triggers a warning in the error_log file. 
> What's triggering these undefined index errors? I suppose 
> I could lower the logging level in php.ini, but I'd rather 
> code properly than to hide the problem. Thanks!




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




Re: [PHP] Need help to choose hosting!

2002-08-02 Thread Michael Sweeney

I just moved my domain over to phpwebhosting.com. The transfer went very
smoothly and so far I've been satisfied. The only hitch I can see in
your requirements might be the background processes (bots, what?). But
it's probably worth asking them about. 

..michael..

On Thu, 2002-08-01 at 23:31, Mantas Kriauciunas wrote:
> Hey php-general,
> 
>   i want to buy hosting. but i can't find good one for me. maybe
>   someone could point some links. but this is what i need!
> 
>   Storage up to 100MB
>   normal transfer limit(best would be without)
>   CGI/Perl/PHP/ASP/SSI/SSL
>   MySQL database (can be only 1)
>   some pop3 mailboxes
>   free domain transfer (maybe free domain if i pay for 1 year ahead)
>   FTP access
>   SSH access
>   Shell capability
>   up to 3 background processes
> 
>   if anyone know combination like that i would appreaciate your help!
>   thanks
> 




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




Re: [PHP] HELP with forms

2002-08-02 Thread Michael Sweeney

What do you mean, "return it to a php variable"?

The closest I can come to understanding your question is that you want
the form input in your bottom frame to be sent to another frame in your
top window for submission.

If that's any place close to correct, you need a javascript solution. In
any case, it won't/can't become a "php variable" until it is sent back
to the server. So why not submit the form from your bottom frame with a
target of the frame that you need the variable in and refresh that
frame?

..michael..

On Fri, 2002-08-02 at 10:14, Dave Leather wrote:
> Is there a way to read a FORM varaiable into PHP variable.  The kicker here
> is the form variable is in a framed window.
> 
> Example, I have my main page in a 2 part frame (90%/10%).  The bottom 10%
> has a form on it called 'fileform' with one text box called filevalue
> 
> -- source snippit --
> 
>   
> 
> -- end snippit --
> 
> Now inside the 90% window, I have ANOTHER frameset (broken into 3 parts.. a
> left menu bar, a bottom instructional bar, and a main window.  I NEED the
> main window to grab the value from the 'fileform.filevalue' and return it to
> a PHP variable.
> 
> Any ideas
> Dave
> 




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




Re: [PHP] Help with fopen please.

2002-08-01 Thread Michael Sweeney

Shane,
You haven't told us what the problem is, only that you're having trouble
making it work. How is it not working? One other question: I have to
assume that the script is running on a different server than the one
your are trying to write to (otherwise, why use ftp?) - are you sure
that the ftp server on that system supports passive ftp? In any case,
fopen may not be the best approach to meet your needs, but you need to
tell us more about what the actual problem is.

..michael..

On Wed, 2002-07-31 at 16:26, Shane wrote:
> Looked in the archive and manual and came up with no luck, so here it goes.
> 
> My end result is to save the output of a PHP script as an HTML file in a specified 
>directory on a WIN2K server.
> 
> my script is such...
>  function save_archive(){
> $filename = "http://myserver.net/extranet/archive.php?jobid=1";;  
> $fd = fopen( $filename, "r" ); 
> $fd2 = fopen("ftp://me:[EMAIL PROTECTED]/extranet/test2.html";, "w");
> 
> while (!feof($fd)) { 
> $line = fgets($fd, 1024); 
> fputs($fd2,$line); 
>   } 
> 
> fclose($fd); 
> fclose($fd2); 
> }
> ?>
> 
> I'm having a terrible time getting this to work. Is there a better way? Or can 
>someone point me toward or post an example of some working function I could study???
> 



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




Re: [PHP] Inserting Processed Data from One Table 2 Another!

2002-07-24 Thread Michael Sweeney

You might want to consider a slightly different approach - that being to
use your php code to generate a delimited file of your data and use
either mysqlimport from the command line if you can, or the LOAD DATA
INFILE sql statement to load the file into your database. That's going
to be a lot faster than running 13000 queries through your php script.

..mike..


On Wed, 2002-07-24 at 00:01, Thomas Edison Jr. wrote:
> Ok i have simple issue, i'm stuck at one point.
> 
> I have a table "Clientdetails" which contains
> ClientID.
> I have created another table "Authentication" with 2
> fields, "ClientID" and "Password".
> 
> I want to pick up the ClientID from table
> "Clientdetails" and insert "ClientID" and a Password i
> have generated using a code, into "Authentication".
> 
> So if there are 13000 ClientID's in "Clientdetails",
> as, many rows with the ClientID & it's corresponding
> password should be Inserted into table
> "Authentication".
> 
> I'm using the following code which i know is wrong,
> what would be correct?
> 
>  $db = mysql_connect("localhost","user","pwd");
> mysql_select_db("myDB",$db);
> 
> $result = mysql_query("SELECT * FROM
> clientdetails",$db);
> if ($myrow = mysql_fetch_array($result)) {
> do {
> 
> $some = $myrow[clientid]
> $newid = eregi_replace('100', '', $myrow[clientid]);
> $date = date("dn");
> $stuff = $newid.def.$date;
> 
> $sql = "INSERT INTO authentication
> VALUES('$some','$stuff')";
> $result = mysql_query($sql);
> echo "All Done!";
> 
> } while ($myrow = mysql_fetch_array($result)); 
> }
> 
> ?>
> 



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




RE: [PHP] Re: does this mean ....

2002-07-23 Thread Michael Sweeney

popen() opens a named pipe to a program - you can read and write to it
if the program you're piping to supports that kind of interactivity
(mostly you just read the output from the command). However, in this
case, I don't think you want either popen() or fopen() (certainly not
fopen() - that just opens a file and that's not at all what you want).
You can use a system call or just backticks around the call to useradd
(if it's on the same server as your web server). If it's not, you'll
have to use sockets and or xmlrpc or some other messaging service.

BUT...you probably know that useradd requires root privs. So you either
have your webserver running  as root (a really really bad idea), or you
have it configured to allow suid programs or you have useradd as suid
root - also not really good ideas.

Maybe you want to take a look at a program called Webmin
(http://www.webmin.com/) that already does what you are talking about. I
haven't used it for several years, but as I remember, it was a pretty
handy tool.

..mike..

On Mon, 2002-07-22 at 17:56, Peter wrote:

> >
> i'm tring to run the useradd command (under Solaris) to add a user to the
> system so i don't have to continueously remote log in and also make it
> easier for myself to add users to the system(s).. maybe popen isn't the best
> option for this .. though i don't think fopen will be able to do what i need
> it to do.. maybe playing around with sockets would be better?
> 
> 
> Cheers
> 
> Peter



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




Re: [PHP] Script Testing Portal Connections...

2002-07-23 Thread Michael Sweeney

Um...did you happen to modify this to have a valid IP address or host
name for $host and a valid port number for $port? It would also help to
have a valid path for $command that is going to talk to a daemon on the
port you specify (ie. making a connection to port 80 and asking for
/usr/games/fortune is not to going to get you far). If you have made
those modifications and it's still failing, some information about what
actually happens in the failure might be helpful.

..mike..

On Tue, 2002-07-23 at 06:10, Kondwani Spike Mkandawire wrote:
> I am trying to test a Script which I got online and
> will modify later (its from devshed)...  It fails to set
> up a connection...
> 
> #!/usr/local/bin/php -q
>  // don't timeout!
> set_time_limit(0);
> 
> // set some variables
> $host = "1.2.3.4...";
> $port = 1234;
> $command = "/usr/games/fortune";
> 
> // create socket
> $socket = socket(AF_INET, SOCK_STREAM, 0) or die("Could not create
> socket\n");
> 
> // bind socket to port
> $result = bind($socket, $host, $port) or die("Could not bind to
> socket\n");
> 
> /*  start listening for connections
> *   My Script Fails here...
>  *  Any suggestions why it fails the Socket SetUp...
>  *  Should I screw around with the port numbers?
>  */
> $result = listen($socket, 3) or die("Set up Failed!");
> echo "Waiting for connections...\n";
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] HELP !!! : Sablotron and not good HTML

2002-07-08 Thread Michael Sweeney

The way out is to write standards compliant markup (meaning 'good'
HTML). Read the RFCs, use a validator, Sablotron will stop complaining. 
(eg:  ) <- (note method to close an image
tag)

..mike..

On Mon, 2002-07-08 at 16:52, Markas wrote:
> Sablotron seems not to like, when in my xsl file occurs "not good" html,
> like  (without closing tag), so how can I deal with this
> problem?!!! Checking and fixing all my HTML , which I want to use in XSL is
> not the way for me..., so I really HAVE to produce bad "not XML like" HTML,
> so I'll have to keep it in my XSL files, and Sablotron doesnt like that!!!
> 
> Is there any way OUT?!!!
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] PHP and Apache

2002-07-02 Thread Michael Sweeney

No. Only you. :-)

Platform? Environment? Configuration information?

..mike..

On Tue, 2002-07-02 at 11:01, B i g D o g wrote:
> Has anyone had a problem where PHP created to many open files and crashed
> apache?
> 
> B i g D o g
> 
> 



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




Re: [PHP] does a form submit from a http page to a https ensuresecure data?

2002-07-02 Thread Michael Sweeney

Your form action parameter has an absolute url specifying an https
protocol. When the browser submits the form, it uses the url you specify
which is https. So the request is going to be encrypted. You might
consider serving the form page from https as well to kind of tighten
things up a little, but the data will be posted under https which is an
encrypted connection. Your main problem is going to be the fact that the
http and https services are accessing two different file system spaces
(or they should be unless you've got your server badly misconfigured) so
the http://...register.php is going to be a different file from the
https://...register.php. You might want to reconsider your design.

..mike..

On Tue, 2002-07-02 at 04:21, B.C. Lance wrote:
> hi,
> 
> the above question has been puzzling me for a while. the situation is this.
> 
> http://domainname.com/register.php
> display a user registration form having
> [form action="https://domainname.com/register.php"; method="post"]
> 
> will the data from that page be encrypted when it is sent via https
> specified in the [form] action?
> 
> note: the registration form is served from http.
> 
> could someone enlighten me on this?
> 
> regards,
> b.c. lance
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] User Enviroment Vars

2002-07-02 Thread Michael Sweeney

Ask them. 

Seriously, PHP is a server-side platform. The only information about the
client that you're possibly going to be able to get is what is passed to
you either through the headers of a request (basically just the remote
address and some browser information), or what the user tells you
through a form submission. The reasons for this limitation should be
pretty obvious. 

..mike..

On Tue, 2002-07-02 at 05:03, James Brisland wrote:
> Has anyone her got any idea how I could access the User Env Vars so I can
> get processor type, speed, ram etc. Is there any way to do this? Or would be
> be something other than PHP. Also I need to do this over the web and not on
> their machine.
> 
> Any ideas?
> 
> James.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] php.ini not creating logs

2002-06-21 Thread Michael Sweeney

First, run a php script that calls phpinfo() and make sure that the php
module in your server is running against the php.ini file you think it
is. Verify the name and path of the log file.

Second, make sure that errors are being reported, meaning check your
php.ini file for the "error_reporting" directive and make sure it says
something like "error_reporting = E_ALL & ~E_NOTICE" - make sure the
line is not commented out.

Third, check the ownership and permissions on the log file AND the
directory the log file is in and make sure that they're such that the
webserver can write to them.

Restart the webserver. Write a php script with an error in it and
request the script. 

Rinse and repeat.

..michael..



On Fri, 2002-06-21 at 11:00, Anil Garg wrote:
> ya i have tried that too..
> wot else can be the problem.
> my php.ini looks like this:

> 
> 
> > Like i said make sure the webserver has the privilege to write to the log
> > file...
> >
> >
> >
> >



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




Re: [PHP] Can I be an ASP with PHP?

2002-06-20 Thread Michael Sweeney

On Thu, 2002-06-20 at 11:29, René Fournier wrote:

> 
> And this is the trick: Can PHP somehow fetch MySQL data over the 
> Internet? Is this possible? If so, is it necessary for me to resort to 
> new, unknown technologies like XML or SOAP, or can I do it with PHP 
> alone?
> 

PHP can fetch (and write) data from any MySQL server that is available
on the internet. You need the hostname, a user name and a password
(details in the mysql_connect documentation). You need to be careful
about how the MySql grant tables are set so that you don't compromise
the database engine, but that's it. So yeah, you could host the Europa
tool on your servers and charge a periodic access to it. If someone
doesn't pay, disable their access to the tool - they still have their
data and database and they can use it however they want. I don't know if
that's a good business model or not, but there's not technical reason
why you can't do it.

..michael..


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




Re: [PHP] Escaping escaped chars

2002-06-20 Thread Michael Sweeney

Just escape the \ with a single escape character. eg. your string
'\0PZ\0<Îê˜Úµ' would end up as '\\0PZ\\0<Îê˜Úµ' - each \ simply
escapes the backslash following it. If you add two backslashes, you end
up with one too many which is what the error is referring to.


..micahel..

On Thu, 2002-06-20 at 10:59, Gerard Samuel wrote:
> Im trying to move some binary strings from mysql to postgresql,
> and the binary strings has escape chars '\' in them.
> I was told to double escape them like so -> '\\\'
> Here is what Im trying ->
> 
> $data = '\0PZ\0<Îê˜Úµ';  // This is a representation from an mysql dump
> $data2 = str_replace('/\', '/\/\/\', $data);
> 
> Im getting ->
> Unexpected character in input: '\' (ASCII=92) state=1
> I guess my str_replace() isn't correct.
> 
> Am I going about the right way to double escape them.
> Thanks.



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




RE: [PHP] Include/require

2002-06-20 Thread Michael Sweeney

Be careful not to get confused between a chrooted environment like the
web server or ftp server and php include paths. PHP handles the include
and require parameters either as absolute (eg /inc/filename is an
absolute path from / - it is not relative to the web docroot.) or
relative to the directories in the php.ini include directive. If you
want to simplify your include and require statements, specify the path
to 'inc' in php.ini and then express the paths to the included files
relative to that.

..michael..

On Wed, 2002-06-19 at 22:43, David Freeman wrote:
> 
>  > Is there a way to make include()/require() take a a full
>  > virtual path?  I.e.  require_once("/inc/myinc.php")?  It gets
>  > a little annoying to do require("../../../../file.php").
> 
> Sure, they should work either way.  The only real gotcha is knowing what
> a full path will be in relation to the web server when it goes to do the
> include/require.  For example, an include for '/inc/myinc.php' has
> particular meaning under *nix that may have it not work even though it
> looks that way to an ftp proggy.
> 
> Part of my normal configuration file for php projects is a declaration
> of $webroot as the path to a document as called from within a browser
> (ie. $webroot = "http://www.some.domain/some/directory";) and $fileroot
> as the path to a document as called from the filesystem (ie. $fileroot =
> "/home/some/user/directory") and then just append as appropriate (ie.
> Include($fileroot/inc/someinclude.php) and away you go.
> 
> CYA, Dave
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] Passing URL as variable

2002-06-20 Thread Michael Sweeney

You need to run the link value through urlencode() before you stick it
in the url. When you need to read it as a legal url again, pass it
through urldecode().

..michael..


On Thu, 2002-06-20 at 11:20, Lisi wrote:
> I have the following link in my code:
> 
> 
>clickrate.php?site=sitename&link=http://www.clientsite.com/store.php?id=430&action=menu
> 
> There are two variables I am trying to pass to clickrate, site and link. 
> The full link is http://www.clientsite.com/store.php?id=430&action=menu.
> 
> The problem is that since the link itself has variables being passed, 
> action is being passed as a separate variable and the full link is getting 
> cut off.
> 
> I tried using htmlspecialchars, and surrounding the link with quotes, but 
> nothing worked.
> 
> Any ideas?
> 
> Thanks,
> 
> -Lisi
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] error log apache over 250 mb after 2 weeks! undefinedvariable?

2002-06-18 Thread Michael Sweeney

It's nothing you have to worry about, but you need to edit your php.ini
file and change the error reporting settings. Find the error_reporting
directives (there will be several, all but one commented out) and
uncomment the one that looks like:

  error_reporting  =  E_ALL & ~E_NOTICE & ~E_WARNING

For production use, you want to use logging (which you're doing) and
only report the parsing and fatal errors. But you might also want to go
through the logs you have now and find the warnings and fix them, just
for good coding practice. You might also want to set the logging to go
to a file that is not your server log file. It'll make it easier to
manage.

..michael..

On Mon, 2002-06-17 at 06:46, andy wrote:
> Hi there,
> 
> my site is online now for only two weeks and I do have a 250 MB apache error
> log file!
> 
> The main entries look like this:
> [Mon Jun 17 15:36:25 2002] [error] PHP Notice:  Use of undefined constant
> level - assumed 'level' in /xx on line 77
> [Mon Jun 17 15:36:25 2002] [error] PHP Notice:  Undefined variable:  default
> in /xx on line 80
> 
> Is this something I have to worry about? I hope that I do not have to change
> all my lines, maybe it would be enough to change the php.ini error level. If
> so, can anybody please give me a hint on what to change there.
> 
> Thanx for any help,
> 
> Andy
> 



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




Re: [PHP] Editor

2002-06-13 Thread Michael Sweeney

I've been using jEdit (www.jedit.org) for months under Linux - very
effective for PHP (as well as Java and many other languages). Perhaps
comparable to TextEdit in the Windows universe, complete with 'snippet'
insertion. Many plugins available, very extensible, very capable editor.

..michael..

On Thu, 2002-06-13 at 12:23, Ray Hunter wrote:
> Actually it is macromedia now.  And it is windows based, what about us linux
> or unix or xbsd guys.
> 
> Ray Hunter
> 
> 
> 
> - Original Message -
> From: "Kurth Bemis (List Monkey)" <[EMAIL PROTECTED]>
> To: "Daniele Baroncelli" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, June 13, 2002 1:24 PM
> Subject: Re: [PHP] Editor
> 
> 
> > At 09:18 PM 6/13/2002 +0200, Daniele Baroncelli wrote:
> >
> > allaire homesite hands down
> >
> > ~kurth
> >
> > >Hi guys,
> > >
> > >Although any editor should be fine when coding PHP, I find that the
> standard
> > >Notepad it's a real pain in the ass. Especially when the script gives you
> an
> > >error at line 222 ! Each time I have to scroll and count each single
> line!
> > >
> > >Can anyone suggest me a different editor ?
> > >
> > >
> > >Cheers
> > >
> > >Daniele
> > >
> > >
> > >




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




Re: [PHP] php, javascript

2002-05-31 Thread Michael Sweeney

On Friday 31 May 2002 13:18, Gerard Samuel wrote:
> Just a general question.  Is it possible to embed php in pure
> javascript/dhtml code??
> I tried but it didn't work, not sure if it was me or its not possible.
> Thanks...

As long as you enclose the PHP code in script delimiters () and 
make sure it is interpreted before sending it back to the browser, it should 
work. Show us the code you're trying that didn't work. Maybe we can give more 
meaningful answers.

..michael..

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




Re: [PHP] Run php function with user click

2002-05-31 Thread Michael Sweeney

On Friday 31 May 2002 05:44, you wrote:
> I know how to have my php code run a function within itself. But is there a
> way that upon an event (clicking a button, etc.), you could run a php
> function without having to go to a new page?

No. PHP is a server side application. The only way to run a function or php 
program is to send a request to the server. When you do that the server sends 
back a response and your broswer refreshes the page. 

..michael..

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




[PHP] Trouble with PHP XMLRPC on Solaris

2002-05-30 Thread Michael Sweeney


I'm trying to get some xmlrpc connectivity working through PHP. Current 
configuration is Apache 1.3.22/PHP 4.2.0 on Solaris 7. I've linked to the 
current expat libraries. Configure and compile don't show any problems and 
other PHP scripts (including phpinfo) work fine. The problem is that an 
xmlrpc call to the Solaris host invariably returns a "Method not found" error 
message. The same xmlrpc server code works flawlessly on a Linux system 
similarly configured (Apache 1.3.24/PHP 4.2) with the same requests.

The only thing I can find is that libxml.so is not installed on the Solaris 
system, but my understanding is that that is a gnome specific library and I'm 
not running gnome on the Solaris box - I haven't been able to find any 
indication that that particular library is required for xmlrpc. 

I've looked everywhere I can think of for a hint, but haven't been able to 
find anything so far. Can anyone shed any light on this problem for me?

Michael
[EMAIL PROTECTED]


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




[PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Sweeney

lol sorry, buttons are too close together in OE.

Anyon ehave a sugestion on a different way of doing what I want to do?
Should be easy but i;m starting to get a headache from this (6-7 years not
doing SQL doesn't help either)



<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Maybe it does in Oracle - you should check your documentation though...
>
> BTW, please post your replies to the list rather than me personally :-)
>
> > -Original Message-
> > From: Michael Sweeney [mailto:[EMAIL PROTECTED]]
> > Sent: 30 May 2002 15:58
> > To: Michael Davey
> > Subject: Re: SQL question, getting error and not sure why
> >
> >
> > I thought it gave you the highest record value, IE recrods
> > containing values
> > 1-10, it would return 10
> >
> >
> > - Original Message -
> > From: "Michael Davey" <[EMAIL PROTECTED]>
> > Newsgroups: php.general
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, May 30, 2002 10:52 AM
> > Subject: Re: SQL question, getting error and not sure why
> >
> >
> > > > insert into acteursenc (nuacteur,nomacteur)
> > > > (select AA, BB from
> > > > (select max(nuacteur)+1 AA from acteursenc),
> > > > (select 'Michael Sweeney' BB from acteursenc))"
> > > >
> > > > produces an ORA-1: unique constraint error.
> > > >
> > > > The primary key is nuacteur, but by setting AA to max(nuacteur)+1 I
> > should
> > > > be getting a new key that is unique, however it does not seem
> > that way.
> > > >
> > > > What am I doing wrong here?
> > >
> > > I'm not an Oracle expert, but surely max(field) + 1 is one
> > higher than the
> > > maximum value possible for the column?
> > >
> > > (Probably irrelevant snippet from mySQL manual:
> > > MAX(expr)
> > > Returns the minimum or maximum value of expr. MIN() and MAX() may take
a
> > > string argument; in such cases they return the minimum or maximum
string
> > > value.)
> > >
> > > regards,
> > >
> > > Mikey
> > >
> > >
> >
> >
> >
>



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




[PHP] SQL question, getting error and not sure why

2002-05-30 Thread Michael Sweeney

My following query :

insert into acteursenc (nuacteur,nomacteur)
(select AA, BB from
(select max(nuacteur)+1 AA from acteursenc),
(select 'Michael Sweeney' BB from acteursenc))"

produces an ORA-1: unique constraint error.

The primary key is nuacteur, but by setting AA to max(nuacteur)+1 I should
be getting a new key that is unique, however it does not seem that way.

What am I doing wrong here?



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




[PHP] Newbie question about PHP and Oracle

2002-05-27 Thread Michael Sweeney

a VERY newbie question, just how do I get data into a listbox? In mysql it
was pretty easy with mysql_fetch_row, but for oracle I am totally lost.


Thanks!





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