CGI question
Mark Papadakis
markp at pathfinder.gr
Sun Sep 26 17:53:47 EEST 1999
Ta submit buttons den pairnun timi an den patithun.
Paradeigma, to .button1 den tha exei timi an patiseis to .button2.
Iparxei kai enas allos tropos.
Dose
<input type=submit name=mybutton value="Pata gia 1">
<input type=submit name=mybutton value="Pata gia 2">
..
Sto CGI an diavaseis ta data apo to mybutton tha einai "Pata gia 1" an eixes patisei to 1, "Pata gia 2" an eixes patisei to 2.
if(!strcmp(mybutton,"Pata gia 1"))
{
printf("Location: http://www.mysite.com/mypage1.html");
return(0L);
}
else if(!strcmp(mybutton,"Pata gia 2"))
{
printf("Location: http://www.mysite.com/mypage2.html");
return(0L);
}
I an pas sti periptwsh twn diaforetikwn names sta submit buttons, ena aplo:
if(button1[0]) // button field has a value, clicked
printf("Location: http://www.mysite.com/mypage1.html");
else if(button2[0]) // button field 2 has a value - clicked
printf("Location: http://www.mysiite.com/mypage2.html");
An theleis des ti Compose form tu Pathfinder Mail gia ena example ( view source ).
Kalh tyxh,
MarkP
Michalis Kabrianis wrote:
>
>On 26-Sep-99 Mark Papadakis wrote:
>> Gia su Michali.
>> Einai sxetika aplo.
>> An theleis na to kaneis me Javascript
>>
>> <input type=button value="Button 1"
>>
>onClick="location.url='http://www.mysite.com/page1.html'"&g
>t;
>>
>> <input type=button value="Button 2"
>>
>onClick="window.location='http://www.mysite.com/page2.html'"
>;>
>
>Thanks alla thelw aystira cgi :-)
>
>> Alliws me CGI
>>
>> <input type=submit name=.button1 value="Click
>1">
>> <input type=submit name=.button2 value="Click
>2">
>> Kai dia vase sto CGI an to field .button1 exei timi i an exei to
>.button 2 ..
>> Ginetai kai alliws alla einai enas tropos...
>>
>> Mark
>
>Nai, alla etsi den kalei to idio CGI me alles parametrous?
>
>
>Michalis Kabrianis
>kabrianis at hellug.gr
>--
>====================================================================
>Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
>Ta archives tis listas einai sto http://lists.hellug.gr/archives
>prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
>Gia opoiodipote problima stilte e-mail ston
>owner-linux-greek-users at hellug.gr
>====================================================================
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/archives
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================
More information about the Linux-greek-users
mailing list