php-windows Digest 24 Aug 2001 08:28:01 -0000 Issue 718
Topics (messages 9025 through 9034):
mysql statment
9025 by: Angie Tollerson
9026 by: Angie Tollerson
9028 by: Erik H. Mathy
Iexplore - php - frames problems with javascript
9027 by: lars-eirik.netcom.no
Fixed the problem with iexplore -frames - php
9029 by: lars-eirik.netcom.no
Re: PHP/VB/Byrefs
9030 by: Eric Pankoke
Re: currency format.... not international format
9031 by: Carlos Rebollo
PHP/Apache module, and the php.ini file
9032 by: Chris
Re: mail function problem
9033 by: Matthias Maar
Re: About "no-cache"
9034 by: Matthias Maar
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]
----------------------------------------------------------------------
I guess the only thing windows related about this is that I have this whole setup on
windows :) But I've tried to help out as much as I can on here so maybe someone will
be kind to me :) Here goes:
I have set up a mysql database column to be LongText (I've also tried LongBlob) and I
tried uploading a block of text to it about 1000 chars in length thru my script. The
sql statement died with a failure to execute. I cut the text in half and then it let
me do it! So I assumed it was length. Which didn't make sense cuz the long fields
don't have length restrictions. So I copy and pasted the same 1000 char data into my
phpMyAdmin to upload it straight into the database that way, and it took it! Anybody
have any ideas as to why my script might be doing this? I won't bother to put all the
code in here, cuz it's just a simple update sql statment like this:
UPDATE dictionary_pending set alt_spelling='addslashes($alt_spelling)',
description='addslashes($description)'";
The description field being the one failing if it is too long. As you can see I tried
adding slashes but to no avail..it really seems to be the length for my scripts but
phpmyadmin doesn't care. Any ideas?
Angie Tollerson
Alliance Technologies
Web Programmer
(515)245-7628
[EMAIL PROTECTED]
Well, I've answered my own question! Apparently, you cannot use the addslashes
function in the sql statement, not the way I am anyways. Does anyone know the proper
way if any to do that without having to do a bunch of extra coding before every sql
statment just to addslashes? Thanks!
Angie
>>> "Angie Tollerson" <[EMAIL PROTECTED]> 08/23/01 04:41PM >>>
I guess the only thing windows related about this is that I have this whole setup on
windows :) But I've tried to help out as much as I can on here so maybe someone will
be kind to me :) Here goes:
I have set up a mysql database column to be LongText (I've also tried LongBlob) and I
tried uploading a block of text to it about 1000 chars in length thru my script. The
sql statement died with a failure to execute. I cut the text in half and then it let
me do it! So I assumed it was length. Which didn't make sense cuz the long fields
don't have length restrictions. So I copy and pasted the same 1000 char data into my
phpMyAdmin to upload it straight into the database that way, and it took it! Anybody
have any ideas as to why my script might be doing this? I won't bother to put all the
code in here, cuz it's just a simple update sql statment like this:
UPDATE dictionary_pending set alt_spelling='addslashes($alt_spelling)',
description='addslashes($description)'";
The description field being the one failing if it is too long. As you can see I tried
adding slashes but to no avail..it really seems to be the length for my scripts but
phpmyadmin doesn't care. Any ideas?
Angie Tollerson
Alliance Technologies
Web Programmer
(515)245-7628
[EMAIL PROTECTED]
--
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]
Hi Angie!
<snip!>
> The description field being the one failing if it is too long.
> As you can see I tried adding slashes but to no avail..it really
> seems to be the length for my scripts but phpmyadmin doesn't
> care. Any ideas?
Hokay...how does phpMyAdmin's code handle insertion of values into the
LongText field(s)? Check that out and see if they do anything different or
interesting. That might give you the insight you need. :)
Just a random thought...
- Erik
Hey there. I am having a major problem for the moment with Iexplorer
and php..
I have tried to run the webpage in OPERA and it does everything it is
suppose to..
I have this problem that when i want to assign a function to a button
which should open new pages in 2 frames (i do this by a javascript
function) it refuses to launch the php page in its window. It only sits
there and acts as if it doesn't find the page. When i run the php page
in a non framed environment it works fine.
I have this function which Iexplorer seems to have problems with
changeframes(navigator,content)
parent.navigator.location.href=navigator.html
parent.content.location.href=content.php
I am not sure if there is a way to make the frame refresh itself.
Is there a function predefined in javascript which can refresh a frame?
It is so frustrating because OPERA displays the webpages and the frames
beautifully, but iexplorer 5 fails to do so.
I would appreciate any help to solve this problem and i do realize it
is not specifically for the windows-php list, but thanks anyways
Lars
I fixed the problem which i asked for help on by deleting a vital part
of the function
it was something like this
function changframes(page,page2)
parent.nav.document.location.href=page
parent.location.document.locaton.href=page2
it turned out that Iexplore only uses the .document with the main frame
itself not the other frames in a frameset.
I know have parent.nav.location=page2 and it works again.!
Lars
I created a simple DLL that contains two functions which give the user a
string: one as a return value and the other as a ByRef argument. The
return value worked and the ByRef didn't.
At 03:39 PM 8/23/01 -0400, Ryan Marrs wrote:
>[Yes this is a repeat, but I didn't receive an answer back, and I
>desperately need an answer]
>
>Thanks!
>
>Anybody know if PHP can handle VB ByRef's when calling a COM object? I've
>searched the documentation and the web and have found nothing on it, so I'm
>going to assume it doesn't, but I just thought I'd check through the list
>before I declared the topic dead.
>
>Thanks!
>
>Ryan
>
>--
>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]
Hello;
There is a standard function that do this: number_format
Take a look in this:
http://www.php.net/manual/en/function.number-format.php
Best Wishes;
Carlos Henrique;
At 15:44 21/8/2001 +0530, sur-php wrote:
>Hello php-windows,
>any body know how to do this ?
>suppose there is a input number "12345678.23"
>i want output to be like this "1,23,45,678.23"
>i don't need output in international format...
>that means not like this fomrmat "12,345,678.23"
>(it is the format used in our country)
>
>so this is what i did...
>-------------------------------------------------------------------------------------
><?
>function convcurr($a)
>{
>$nadael=substr($a,-2,1);
>$nadael2=substr($a,-1);
>if ($nadael===".") {$a=$a."0";}
>elseif ($nadael2===".") {$a=$a."00";}
>
>$check=strpos($a,'.');
>$check1=strlen($check);
>if ($check1==0 and $a<>0) {$a=$a.".00";}
>
>$b=strlen($a);
>$c=strpos($a,".");
>$d=substr("$a",$c);
>$e=substr("$a",0,-($b-$c));
>$f=strlen($e);
>$aa="";
>
>for ($i=1;$i<$f+1;$i++)
> {
> $g=substr("$e",-$i,1);
> $aa=$g.$aa;
>
> if($i==3){$aa=",".$aa;}
> if($i==5 and $i<$f){$aa=",".$aa;}
> if($i==7 and $i<$f){$aa=",".$aa;}
> if($i==9 and $i<$f){$aa=",".$aa;}
> if($i==11 and $i<$f){$aa=",".$aa;}
> if($i==13 and $i<$f){$aa=",".$aa;}
> }
>
>$summa=$aa.$d;
>$replace=str_replace("-,","-",$summa);
>$issmall=strlen($replace);
>if ($issmall<8) {$replace=str_replace(",","",$replace);}
>echo "$replace";
>}
>?>
>
>-------------------------------------------------------------------------------------
>
>this works for me...
>it should be used in this was
>-------------------------------------------------------------------------------------
><?
>include ("curr-convert.php");
>$a="12345678.23"
>convcurr($a);
>?>
>-------------------------------------------------------------------------------------
>but i think there must be some easy way....
>can anyone can give idea about it ?
>i think you understood what i wrote here...
>
>
>
>--
>Best regards,
> sur-php mailto:[EMAIL PROTECTED]
>
>
>
>--
>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]
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.268 / Virus Database: 140 - Release Date: 7/8/2001
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.268 / Virus Database: 140 - Release Date: 7/8/2001
I have PHP/4.06 running as a module within Apache, and when I change my
php.ini file, I noticed that when I call <?phpinfo()?> I notice that
there are no changes! This doesen't seem to happen when running CGI
version of PHP...
...any ideas?
NOTE: I have tried restarting Apache, Shutting down and restarting
Apache, restarting Windows98, ect, ect. I have also double checked to
see if I had more that one copy of the php.ini file, and I have only
one.
Any help would be greatly appreciated,
Chris
Hi.
I tested the script on my server and it works! Just ignore the mail you got.
So the error has something to do with your smtp server. Look at your
server's log file to find out if there is a problem with user/password for
php. It may be necessary to create a new account for the php-user you set in
the ini-file (sendmail_from).
MfG
Maar
----------------------------------------
Matthias Maar
Lehrstuhl für Informatik I
Universität Würzburg
Am Hubland
D-97074 Würzburg
Germany
Tel.: ++49 (0) 931/888-4941
Fax: ++49 (0) 931/888-4600
http://www1.informatik.uni-wuerzburg.de
"Pierre A. Fortier" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I installed php on my Windows-ME machine. Most of it works properly. One
> problem is that the mail function doesn't work. I used:
> mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3").
>
> Below is how I setup php, smtp server address added to php.ini, php
> program I tested, and its output.
>
> How could I get mail() function to work?
>
> Pierre Fortier
> [EMAIL PROTECTED]
>
>
> Summary of setup
> - created directory C:\PROGRA~1\Sambar\Php which contains the files
> install.txt
> php.exe
> php4isapi.dll
> License
> Test.php
> and directories uploadtemp and sessiondata
> - php.ini is in \windows directory
> - php4ts.dll is in the system directory
> - autoexec.bat file contains
> SET PHPRC=C:\PROGRA~1\Sambar\Php
> and C:\PROGRA~1\Sambar\Php; in the PATH definition
> - C:\PROGRA~1\Sambar\config\mappings.ini has the following entry
> *.php = C:\PROGRA~1\Sambar\Php\php4isapi.dll
>
> php.ini includes
> [mail function]
> SMTP= smtp-out.uottawa.ca
>
>
> PHP program http://hawk.med.uottawa.ca/MailTest.php
>
> <html>
> <head>
> <title>Example</title>
> </head>
> <body>
> <?php
>
> $i=10;
> echo "Hi, I'm a PHP script! I'm $i times better than ASP
> scripting!<p>";
> for ($i = 1; $i <= 10; $i++) {
> printf("%d times<br>\n", $i);
> }
> mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
> ?>
> </body>
> </html>
>
> Output:
> Hi, I'm a PHP script! I'm 10 times better than ASP scripting!
> 1 times
> 2 times
> 3 times
> 4 times
> 5 times
> 6 times
> 7 times
> 8 times
> 9 times
> 10 times
>
> Warning: Unknown error in c:\users\server\MailTest.php on line 16
>
>
Hi.
Do you really think preventing the browser from caching the page is what you
need here? I think no.
Whenever the page is shown/reloaded you need to check if the user already
has been "counted". This may be done by setting some information in a cookie
(you mentioned one). The code for your counter just has to get that
information and increase when not set.
Or did I get something wrong?
MfG
Maar
----------------------------------------
Matthias Maar
Lehrstuhl für Informatik I
Universität Würzburg
Am Hubland
D-97074 Würzburg
Germany
Tel.: ++49 (0) 931/888-4941
Fax: ++49 (0) 931/888-4600
http://www1.informatik.uni-wuerzburg.de
"Science" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> I am using cookie to write a counting page but when the page is
refreshed,
> it will increase by 1 automatically.
> According to this problem, I used following lines but it doesn't work
> --------------------------------------------------------------------------
--
> --
> header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
> header ("Cache-Control: no-cache, must-revalidate");
> header ("Pragma: no-cache");
> --------------------------------------------------------------------------
--
> ---
> even I used html script
> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
> <META HTTP-EQUIV="Expires" CONTENT="-1">
>
> Well, Is there anyone who knows how to prevent the page to be cached?
>
> Thanks a lot
>
>