php-windows Digest 10 Jan 2001 16:08:14 -0000 Issue 389 Topics (messages 4896 through 4902): Re: php_mssql70.dll Access Denied 4896 by: Mauro Boschi File upload not working 4897 by: MacBane 4901 by: Asendorf, John Equivalent ways to populate an array. 4898 by: Paul Meagher Re: Header function on IIS vs. Apache 4899 by: Phil Driscoll Re: Sorry, answered too quick [waas: SET in MSSQL-query] 4900 by: Thomas decimal numbers 4902 by: afan 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] ----------------------------------------------------------------------
Hi, I'm trying to understand why something like this: DECLARE crs CURSOR KEYSET FOR SELECT title FROM article WHERE pub_id = 1 OPEN crs FETCH ABSOLUTE 3 FROM crs DECLARE @var INT SET @var = 0 WHILE (@var<10) BEGIN FETCH NEXT FROM crs SET @var = @var +1 END CLOSE crs DEALLOCATE crs Doesn't work when you try to embend it in a PHP/MSSQL query!? There's something that I doesn't mind about this? Maybe a LOCAL PROCEDURE works better? What I have to do is just emulate the LIMIT function that MySQL have in his set of command. This function is very useful when you have to extract only a set of row from the query with an absolute start position. THANKS A LOT Mauro
File uploading is not working for me on my server, it is a windows 2000 box running php 4.02 this is my code <?php include("db_con.php"); include("logincheck.php"); if(isset($page_id)); $page_id =("$page_id"); print(" <FORM ENCTYPE='multipart/form-data' ACTION='uploadfile.php' METHOD=POST> <INPUT TYPE='hidden' name='MAX_FILE_SIZE' value='5000000'> <INPUT NAME='userfile' TYPE='file'> <input type='hidden' name=page_id value='$page_id'> <INPUT TYPE='submit' VALUE='Send File'> </FORM>"); ?> <?php if (is_uploaded_file($userfile)) { move_uploaded_file($userfile, "C:\nusphere\apache\htdocs\morgan\php\database\CMS\pdf"); } ?>
What error are you getting? I'm doing uploads but with different code... these functions are new to me. The first thing I would check is the slashes in your move function, perhaps they need to be forward slashes? --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 The benefit to the government of replacing all $1 Federal Reserve notes with $1 coins would be $522.2 million per year, according to estimates of the General Accouting Office released on April 7, 2000. > -----Original Message----- > From: MacBane [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 10, 2001 1:35 AM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] File upload not working > > > File uploading is not working for me on my server, > > it is a windows 2000 box running php 4.02 > > this is my code > > <?php > include("db_con.php"); > include("logincheck.php"); > if(isset($page_id)); > $page_id =("$page_id"); > print(" > <FORM ENCTYPE='multipart/form-data' ACTION='uploadfile.php' > METHOD=POST> > <INPUT TYPE='hidden' name='MAX_FILE_SIZE' value='5000000'> > <INPUT NAME='userfile' TYPE='file'> > <input type='hidden' name=page_id value='$page_id'> > > <INPUT TYPE='submit' VALUE='Send File'> > > </FORM>"); > ?> > > > <?php > if (is_uploaded_file($userfile)) > > { > > move_uploaded_file($userfile, > "C:\nusphere\apache\htdocs\morgan\php\database\CMS\pdf"); > > } > ?> > > > > > > > -- > PHP Windows 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] >
I can successfully populate the params array in this way: class MyDB extends DB { var $params = array( 'phptype' => "mysql", 'hostspec' => "localhost", 'database' => "testdb", 'username' => "root", 'password' => "" ); } Then I try to do it this way: class MyDB extends DB { var $params = array(); $this->params['phptype'] = "mysql"; $this->params['hostspec'] = "localhost"; $this->params['database'] = "testdb"; $this->params['username'] = "root"; $this->params['password'] = ""; } I get this error for the second way: Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:/apache/htdocs/004.php on line 15 Line 15 is this line: $this->params['phptype'] = "mysql"; I also tried populating the array by dropping $this-> and just having $params['phptype'] = "mysql"; but I still get the same error. Anybody know why I am getting this error? Regards, Paul
>I am tweaking a PHP web app developed on Apache/Linux/PHP3 to work on >IIS/Win2k/PHP4. I have encountered an unusual situation with the header() >function in PHP. When a user submits a form, depending on the results they >are redirected to a certain URL using the Header function (usually something >like /folder/TheFile.php3?this=that). This works on the Apache/Linux/PHP3 >setup but not on the latter - it generates one of those unhelpful 502 CGI >Errors (The specified CGI application misbehaved by not returning a complete >set of HTTP headers. The headers it did return are:). In some cases just >refreshing the page will cause it to load properly; in other cases, not. The error you are getting occurs most often when the php file does not exist. Maybe there is sometimes an error in the url in the header you output? Two ways of debugging for this I can thing of are: Instead of sending out a header, output a page with a link on it so you can read the URL. Configure IIS to 'check file exists' for the .php extension (or whatever extension you are using). If the error changes to a 404, then the script does not exist. If the error stays the same, then the script is not outputting anything at all for some reason. Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
Hello Frank, thanks for your answer! Are these new functions the offered Source from guy somewhere in the List ?:) But now the serious question: To be able to change to CGI, I need to upgrade php4.04 (u know, GD and CGI in 4.03). Now I want to compile the 4.04 Release-Source, but with the php_mssql.c v1.36 (return true instead false) as soon as I've got Visual C (Don't wanna risk a cvs-version again). Can this work properly, or have you changed other source-files also (concerning the "update returns false instead true-bug")? Many thanks in advance! Best regards, Thomas "Frank M. Kromann" wrote: > Textsize and textlimit are connected. Textsize can be set to any value from 0 to >textlimit and text limit can be any value from 0 to 2Gb (on 32 bit API) > > By default textsize and textlimit are set according to your server and library >settings but if you have textlimit = 8192 in php.ini you will not be able to use a >higher value. > > Textlimit can not be set with a SET command, you have to configure the value in >php.ini or setting the value on the server. > > The next version of php_mssql70.dll includes a new function mssql_setopt() allowing >you to set this an 17 other options from the script. > > - Frank
Hi all, short and simple question: >From total of 123 elements 79 are ok. What percent? $Total = 123; $ok = 78; $Percent = (100 / 123) * 78; // 63.41463414... But I need just two decimal: 63.41 I'm doing it this way: $Percent = $Percent * 10; // 6341.463414... settype($Percent, "integer"); // 6341 $Percent = $Percent / 10; // 63.41 I thing there is much better solution! Thanks for help Afan