Witam!
Otóż mam mały problem... Od 2 dni piszę skrypt dla zaprzyjaźnionej serwerowni... Ma być to skrypt "sklepu".
Aktualnie skrypt "stoi" na kodzie z formularza kontaktowego... Ale nie w tym rzecz... Prosiłbym o pomoc z dopisaniem do tego kodu kalkulatora, chodzi mi o to że np. jak wybieramy jakąś opcje to obok pokazuje się kwota, jeśli zaznaczymy coś jeszcze to kwota zmieni się (coś takiego ja cenniki hostingów np. niceshoot). Najlepiej można by było gdyby była możliwość dodania pod kwotą nr1, kwote nr 2 (oczywiście z inną wartością)...
Mniej więcej wiecie o co mi chodzi... Trochę niejasno wytłumaczyłem
Proszę o pomoc.
Niżej daje kod, kod jest odzyskany z oryginału dlatego niektóre pola są po angielsku i niewypełnione...
Wiem że to trochę nie tak jak powinno być ale dopiero się uczę

Z góry dziękuje za odp.
<?
// Enter your email address here
$adminaddress = "misioroslaw@o2.pl";
// Enter the address of your website here MUST include http://www. $siteaddress ="http://www.cs-maxboard.pl";
// Enter your company name or site name here
$sitename = "Your Name";
// Enter your page title here
$ptitle = "Your Page Title";
// Colour/Style Values for your page - hexy!
//Background Colour
$bgcolor = "#000000";
//Table Border
$bocolor = "#444444";
// Font Colour
$fcolor = "#ffffff";
// Link Colour
$lcolor = "#ff0000";
// Font Style
$font = "arial";
// Font Size
$fontsize = "3";
// Unless you know better I advise that you don't touch anything below here!
// Don't touch this it grabs the date and time from your server
$date = date("m/d/Y H:i:s"); $vers = "CS-MaxBoard Shop v1.0";
$traceroute = "<a href=\"http://www.above.net/cgi-bin/trace?$REMOTE_ADDR\">";
if ($REMOTE_ADDR == "") $ip = "<i> no ip </i>";
else $ip = getHostByAddr($REMOTE_ADDR);
IF ($action==""):
?>
<html>
<head><title>
<? echo "$ptitle"; ?></title>
<body bgcolor="
<? echo "$bgcolor"; ?>" Link="
<? echo "$lcolor"; ?>" vLink="
<? echo "$lcolor"; ?>">
<center>
<FORM name=validation METHOD=POST ACTION="
<? echo "$PHP_SELF"; ?>" onSubmit="return checkbae()">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" width=50% bgcolor="
<? echo "$bocolor"; ?>">
<TR>
<TD VALIGN="TOP">
<center><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3" width=100% bgcolor="
<? echo "$bgcolor"; ?>">
<TR>
<TD VALIGN="TOP" colspan=2><font face="
<? echo "$font"; ?>" size="
<? echo "$fontbig"; ?>" color="
<? echo "$fcolor"; ?>"><b>
<? echo "$ptitle"; ?></b></FONT><br><img src="http://cache.www.gametracker.com/server_info/94.23.92.224:27025/b_350_20_525252_2B2C2B_FFFFFF_000000.png" alt="" border="0" height="20" width="350"><BR><BR></TD>
</TR>
<TR>
<TD VALIGN="TOP"><font face="
<? echo "$font"; ?>" size="
<? echo "$fontsize"; ?>" color="
<? echo "$fcolor"; ?>"><small>Nazwa na forum:</FONT></TD>
<TD VALIGN="TOP"><INPUT TYPE="text" NAME="forum"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><font face="
<? echo "$font"; ?>" size="
<? echo "$fontsize"; ?>" color="
<? echo "$fcolor"; ?>"><small>Nazwa na serwerze:</FONT></TD>
<TD VALIGN="TOP"><INPUT TYPE="text" NAME="server"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><font face="
<? echo "$font"; ?>" size="
<? echo "$fontsize"; ?>" color="
<? echo "$fcolor"; ?>"><small>Gadu Gadu:</FONT></TD>
<TD VALIGN="TOP"><INPUT TYPE="text" NAME="gg"></FONT></TD> </TR>
<TR>
<TD VALIGN="TOP"><font face="
<? echo "$font"; ?>" size="
<? echo "$fontsize"; ?>" color="
<? echo "$fcolor"; ?>"><small>Kupuję:</FONT></TD> </TR>
<TR> <TD VALIGN="TOP"><select name="item" multiple="multiple">
<option selected="selected">WYBIERZ</option>
<optgroup label="Poziomy">
<option>+5</option>
<option>+10</option>
<option>+15</option>
<option>+20</option>
<option>+25</option>
</optgroup>
<optgroup label="Dodatkowe">
<option>Administrator</option>
<option>ViP</option>
</optgroup>
<optgroup label="Klasy">
<option>Klasa ViP</option>
<option>Klasa Premium</option>
</optgroup>
</select></FONT></TD> </TR>
<TR><td colspan=2><INPUT TYPE="submit" NAME="action" VALUE="Kupuję">
</FORM></TD>
</TR>
</TABLE> </CENTER></td></TR>
</TABLE>
<script language="JavaScript1.2">
var testresults
function checkemail(){
var str=document.validation.vemail.value
var filter=/^.+@.+\..{2,3}$/
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}
</script>
<script>
function checkbae(){
if (document.layers||document.all)
return checkemail()
else
return true
}
</script>
<?
//This grabs the form data and formats it and sends it in an email to you
ELSEIF ($action="Send"):
mail("$adminaddress","Info Request", "FAO: Admin @ $sitename \n First Name: $forum
Last Name: $server
Email: $gg
Company: $wybor
------------------------------
Logi :
------------------------------
Skrypt: $vers
Przeglądarka: $HTTP_USER_AGENT
Hostname: $ip
IP: $REMOTE_ADDR
Data/Godzina: $date","FROM:$adminaddress");
//This grabs the form data and sends a confirmation to your visitor
mail("$vemail","Thank You for visiting $sitename", "Hi $fname,\n Thank you for your interest in $sitename!
We will read your comments as soon as we can and act accordingly.
You can expect a response within 48hrs.\n
Best regards,
$sitename
$siteaddress","FROM:$adminaddress");
PRINT "<html><head><title> $ptitle </title><body bgcolor=\"$bgcolor\" Link=\"$lcolor\" vLink=\"$lcolor\"><CENTER>"; PRINT "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"3\" width=\"60%\" bgcolor=\"$bocolor\">"; PRINT "<TR><TD VALIGN=\"TOP\">"; PRINT "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"3\" width=\"100%\" bgcolor=\"$bgcolor\">"; PRINT "<TR><TD VALIGN=\"TOP\"><font face=\"$font\" color=\"$fcolor\"><small>Hello, $fname."; PRINT "<font face=\"$font\" color=\"$fcolor\">Thank you for your completing our form.<BR><BR>"; PRINT "<font face=\"$font\" color=\"$fcolor\">We will send information to<b> $vemail </b>, within 48hrs.<br>"; PRINT "<font face=\"$font\" color=\"$fcolor\">To return to our homepage [<A href=\"$siteaddress\">Click Here</A>]"; PRINT "</CENTER></td></TR></TABLE></td></TR></TABLE>"; ENDIF;
?>
</body>
</html>
Chodzi mi tutaj dokładniej o to aby po zaznaczeniu któregoś z tych opcji pojawiała się obok tego kwota
<option selected="selected">WYBIERZ</option>
<optgroup label="Poziomy">
<option>+5</option>
<option>+10</option>
<option>+15</option>
<option>+20</option>
<option>+25</option>
</optgroup>
<optgroup label="Dodatkowe">
<option>Administrator</option>
<option>ViP</option>
</optgroup>
<optgroup label="Klasy">
<option>Klasa ViP</option>
<option>Klasa Premium</option>
</optgroup>
</select>
Ten post edytował miras1309 6.04.2011, 21:07:29