Jump to content
php.lv forumi

Sadalīšana pa tabulām + funkcijas ..


snach15

Recommended Posts

Sveiki vēlreiz.

1.tātad turpinu mācīties ar visādām funkcijām un atkal apstājos pie vienas lietas ko pats nespēju pabeigt ... Šeit ir viens nu pliks html un otrā ir + php , izkatās jav diezgan elementāri bet pirmo reizi ar šādu lietu sadūros, tātad kā lai es šos "2.scripts" ielieku "1.scripts" tā lai funkcijas darbojas jo kad es liku man kautkas atkal neiet .. tātad nemāku tieši ielikt iegš tabulas .. vajadzētu šo "<input type="text" name="acc" value="<?php echo $acc?>"/><br />" rindiņu ievietot iegš tabulas "delete warning points" un "<input type=submit value=Apstiprinat />" Ielikt iegš "Delete" Go vietā .. kā lai to paveic?

 

 

2.tātad ar šo scripta palīdzību itkā atskaitā punktus 0/50, kā būtu jāizveido pareizi configs scriptam tā lai spēlētājs input ailē ierakstot savu skaitli no 1 - 50 un spiežot Submit pogu viņam norautu attiecīgi WZ credītus tā lai dzēšot vienu punktu atņemtu 1 credītu ?

 

Būšu ļoti pateicīgs par palīdzību

 

 

 

1.Scripts

<html>
<head>
<style type="text/css">
<!--
.style2 {	font-size: 12px;
color: #FFFFFF;
font-family: "Times New Roman", Times, serif;
}
.style3 {color: #FFFFFF}
-->
</style>
</head>
   <body>
   <table width="457" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#212121" bgcolor="#212121">
     <tr>
       <td width="12" bgcolor="#105830" class="style2"><div align="center">#</div></td>
       <td width="131" bgcolor="#105830"><div align="center" class="style2">Account</div></td>
       <td width="110" bgcolor="#105830"><div align="center" class="style2">You have Warn p.</div></td>
       <td width="110" bgcolor="#105830"><div align="center" class="style2">Delete Warn ponts</div></td>
       <td width="78" bgcolor="#105830"><div align="center"><span class="style2">Delete</span></div></td>
     </tr>
     <tr>
       <td bgcolor="#212121" class="style2">1.</td>
       <td bgcolor="#212121" class="style2"><div align="center" class="style2"><? echo $_SESSION['user_login_name'] ?></div></td>
       <td bgcolor="#212121"><div align="center" class="style3"><? echo $warning ?>/50</div></td>
       <td bgcolor="#212121"><div align="center"></div></td>
       <td bgcolor="#212121"><div align="center" class="style3">Go</div></td>
     </tr>
   </table>
   <p> </p>
   <table width="457" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#212121" bgcolor="#212121">
     <tr>
       <td bgcolor="#105830" class="style2"><div align="center">Info</div></td>
     </tr>
     <tr>
       <td bgcolor="#212121" class="style2"><div align="center">
         <p>1 Warning punkts = 1 WebShop Credits<br>
         10 warning Punkti = 10 Webshop Crediti<br>
         50 Warning Punkti = 50 Webshop Crediti</p>
         </div></td>
     </tr>
   </table>
   <p> </p>
   <p> </p>
</body>
</html>

 

2.Scripts

<html>
<head>
  </head>
   <body>
    <h1>Script</h1>
<?php function show_form($acc="") { ?>
          <form action="char2.html" method="POST">
          <input type="text" name="acc" value="<?php echo $acc?>"/><br />
          </select><br />
          <input type=submit value=Apstiprinat />
          </form><p><?php } 

if($_SESSION['admin_login'] == 'ok')
 if($_SERVER['REQUEST_METHOD']!='POST') {
         show_form( );
     } else {
        if(empty($_POST['acc'])) {
     echo "<p>Error";
          show_form($_POST['acc']);
           } else {
      mssql_query("UPDATE MEMB_INFO SET warning = warning - '".$_POST['acc']."' WHERE MEMB___ID = '".$_SESSION['user_login_name']."'");  } }

      ?>

</body>
</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...