php-windows Digest 22 Aug 2001 12:09:52 -0000 Issue 715

Topics (messages 8984 through 8993):

Re: How do I get information from a URL?
        8984 by: Hugh Bothwell
        8985 by: CJD

Re: Array
        8986 by: CJD

format....not international........
        8987 by: sur-php

permission problem
        8988 by: lolodev news php

PHP sessions under Win2k AS
        8989 by: Mike Duin

Performance issues php/apache
        8990 by: Andrew.Martin

issue with undefined variables with PHP 4.06
        8991 by: Philip Meier
        8993 by: Johannes Janson

Help with mysql rowpointer
        8992 by: Lars Eirik Rønning

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]


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



"Jeff Howard" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to get information from a URL in a way similar to utilizing GET
> in ASP.  I know how to get information by submitting a form and going to a
> new page, but how can I use the form to stay on the same page, yet be able
> to retrieve the information?
>
> For example:
>
> I start on http://www.mypage.com.  I have a form to submit some
information,
> but want to remain on this page.  The result of the query looks like:
>
> http://www.mypage.com?id=5
>
> I want to be able to extract the 5

Try $id  (or $HTTP_GET_VARS["id"] if you want to be pedantic)






create a form which posts to itself and in the page have this:

if ($Submit=="Submit") { # where $Submit is the name of the submit button.
    # do form validation/actions here
} else {
    # display the form here
}



"Jeff Howard" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to get information from a URL in a way similar to utilizing GET
> in ASP.  I know how to get information by submitting a form and going to a
> new page, but how can I use the form to stay on the same page, yet be able
> to retrieve the information?
>
> For example:
>
> I start on http://www.mypage.com.  I have a form to submit some
information,
> but want to remain on this page.  The result of the query looks like:
>
> http://www.mypage.com?id=5
>
> I want to be able to extract the 5
>
>






To have the items auto-numberd so as to skip blank entries, use:

for ($i = 1; $i<6; $i++) {
   print "<input type=\"text\" name=\"test[]\">\n";
}

then if on items 1,2 and 5 are filled in, you will have a array with just 3
elements in it.



"Mike Flynn" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Alternately, though I think the array solution is probably the most
> durable, you could also do it as such:
>
> for ($i = 1; $i<6; $i++) {
>    print "<input type=\"text\" name=\"test$i\">\n";
> }
>
> and then retrieve them as $test1 thru $test6, or if you want to use a loop
> like this:
> for ($i = 1; $i < 6; $i++) {
>    $thevariable = "test$i";
>    $thevalue = $$thevariable;
> }
>
> At 03:36 PM 8/21/2001 +0200, Darvin Andrioli wrote:
> >Change your code in:
> >
> >  <?
> >  for ($i=1; $i<6; $i++) {
> ><input type="text" name="test[$i]">
> >}
> >?>
> >
> >You will obtain an array, named test, with 5 elements.
> >
> >Bye
> >
> >Darvin
> >
> > > -----Messaggio originale-----
> > > Da: Sichta Daniel [mailto:[EMAIL PROTECTED]]
> > > Inviato: martedi 21 agosto 2001 15.15
> > > A: [EMAIL PROTECTED]
> > > Oggetto: [PHP-WIN] Array
> > >
> > >
> > > Hi there !!
> > > cfg: php4.0.4pl1, w2k, apache 1.3.20
> > > Situation:
> > > <?
> > > for ($i=1; $i<6; $i++) {
> > > <input type="text" name="test">
> > > }
> > > ?>
> > > This is all in one form. How can I get all five values of test from
this
> > > kind of code ?
> > >
> > > DAN
> > >
> >
> >--
> >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]
>
>
>                -=- Mike Flynn - Burlington, VT -=-
> [EMAIL PROTECTED]  http://www.mikeflynn.net/  * Give blood *
> the classic example of liberal, consensus, win-win,
> Clintonesque, spin doctor, sell-out, cultural appropriation,
> commodification of dissent type event in the world today
>     (-BBB)
>
>






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]






i 've win 2ks, php4,iis5.

i try to dev a upload program with a copy function.

when i test, i've an error:

Warning: Unable to create
'D:\users\Apache\www-serveurs\cgpme-54\htdocs\Infos': Permission denied in
D:\users\Apache\www-serveurs\cgpme-54\htdocs\scripts\actu.php on line 53

i 've put right IUSR_server to my directory with write permission.

i don"t no what to do ??






Hi All,

I am running PHP 4.0.4 on Win2k Advanced Server, but because of the huge
amount of traffic the surfer stops working....

When I take a look @ the taskmanager I see an average of 70 php
sessions.....hhhhmmm.....he doesnt like that.
All the sessions are from one script that reads a file from filesystem and
makes a connection to an Informix database.

I tried to solve this bby using ifx_pconnect....but it wouldnt stop opening
new sessions... How To?

Greetz

Mike






I'm using PHP with Apache server but I have big performance issues. Not sure
if its php or apache causing them. When I load/refresh a page you can see
the images loading in the status bar before the page loads. I do use js
preload functions for the images, which I used before (with apache) without
these issues occuring.

Anyone got any idea of how to improve performance. Is there an add on to
apache for this?

thanks,

Andrew




Hi

I have just reinstalled my win2k system and installed the latest version of
PHP (4.06), now when I run a lot of my old scripts I get errors like the one
below, when I access the page before posting any data to it.  The example
below is taken straight from a tutorial site.  I'm not sure if this is a
change in PHP since 4.01 which I had been using or what ?

Can anyone help please ?!

Thanks

Phil

Warning: Undefined variable: name in u:\inetpub\wwwroot\php\form5.php on
line 7



<html>
<body><h1>My Example Form</h1>
<form action="form5.php" method="POST">
Name: <input type="text" name="name">
Age: <input type="text" name="age">
</form>
<?if($name):?>
Hi <?echo $name?>, you are <?echo $age?> years old
<?endif?>
</body></html>








hi,

> I have just reinstalled my win2k system and installed the latest version
of
> PHP (4.06), now when I run a lot of my old scripts I get errors like the
one
> below, when I access the page before posting any data to it.  The example
> below is taken straight from a tutorial site.  I'm not sure if this is a
> change in PHP since 4.01 which I had been using or what ?
>
> Can anyone help please ?!
>
> Thanks
>
> Phil
>
> Warning: Undefined variable: name in u:\inetpub\wwwroot\php\form5.php on
> line 7

That's just a warning not an error mesage. Change the error_reporting in the
php.ini
to E_ALL (I think it is) or put error_reporting(7) on top of the scripts.

cheers
johannes






Hey there. I realize this is a forum for php-windows users,but knowing
that most of you guys run a mysql db as backend i have a question for
you..

I know there is a way to return the amount of records in the db by using
the mysql_num_rows($resultid). My problem is that it only returns the
total number of records from my query

I have seen that there is a function called mysql_data_seel(par,par),
but i am not sure how it works.

My problem is the following>
i want to do a print out of each record in the db , but the HTML code
(to be exact the positioning of the HTML table should be different
depending on the number of record printed out.

To illustrate this is more or less what i want >

i want to print out record 1 in one style , then i want to next record
to be printed out in a different way. Is there a way to do a check on
which number of record is printed out.
I realize i cannot use the id simply because if i do a printout of total
4 records and i want to use a record with id = 100 e.g then it won't do
me any good.

Basically is there a way for me to check the number of record is printed
out on a page. If i want to print out 4 records then the first row
should be 1..Regardless of the ID stored in the db.

I hope you understand me .if now i would be happy to reply with a more
detailed instruction on my problem.

in ODBC db i know one can use the rs.next object and method, but is
there an equivalent to this in MYSQL..

Thanks everyone

Lars Eirik




Reply via email to