webForumDet fria alternativet

Placeringen blir inte rätt...

PHP

3 svar · 251 visningar · startad av Putte_sky

Medlem sedan juli 20049 inlägg
Frågan#1

Hej!
Jag håller på med det nedan,
Jag skulle vilja att om man klickar på I accept så försvinner radioboxarna och så kommer formulären där istället... Som där är nu ligger det klart och så blir det ärr jätte långt mellan rum emellan dem. :?

<?php
include "include.php";
?>
<head>
<title>Skyways VA</title></head>
<html>
<body BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" onLoad="" LINK="#CE1141" VLINK="#CE1141" ALINK="#CE1141">
<table width="685" border="0" height="310">
  <tr> 
    <td valign="top"  class="table1" height="285"><b>Join</b><br>
    <br>
    Join Skyways VA is very easy, Just fill out the form below this text after 
    that you have<br>
    accepted all our conditions.<br>
    <br>
    &#149; You must be at least 13 year.<br>
    &#149; You must have a legal copy of Microsoft Flight Simulator 2002/2004<br>
    &#149; You must have some knowledge about how to fly in MSFS.<br>
    &#149; It's very good if you have some online flying knowledge. (Read our 
    manual then you can login)<br>
    &#149; You must be capable to fly one flight in every month.<br>
    <br>
	<form>
 <input type="radio" name="yes" value="yes" onclick="this.form.submit()" />
      I <b>accept</b> all the conditions and are 13 year or older.<br>
<input type="radio" name="no" value="no" onclick="this.form.submit()" />
      I <b>don't</b> accept the conditions.
      </form>
      </td>
  <?php
  if(isset($_GET['yes'])) { ?>
<table width="679" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="169" class="table1"><b>Firstname:</b></td>
          <td colspan="2" class="table1"> 
            <input type="text" name="textfield" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="169" class="table1"><b>Lastname:</b></td>
          <td colspan="2" class="table1"> 
            <input type="text" name="textfield2" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="169" class="table1"><b>Year of birth:</b></td>
          <td colspan="2" class="table1"> 
            <input type="text" name="textfield3" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="169" class="table1"><b>Password:</b></td>
          <td width="333" class="table1"> 
            <input type="text" name="password" class="falt">
            &nbsp;&nbsp;<a href="join.php?pass_show=show"><b>Show my password 
            &raquo;</b></a></td>
          <td width="177" class="table1"> 
            <? echo $show; ?>
          </td>
        </tr>
        <tr> 
          <td width="169" class="table1"><b>Email:</b></td>
          <td colspan="2" class="table1"> 
            <input type="text" name="textfield5" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="169" class="table1"><b>Vatsim id:</b></td>
          <td colspan="2" class="table1"> 
            <input type="text" name="textfield6" class="falt">
          </td>
        </tr>
        <tr> 
          <td colspan="3" class="table1"><b>Short info about your self:</b></td>
        </tr>
        <tr> 
          <td colspan="3" class="table1">
            <textarea name="comment" cols="32" rows="4" class="falt"></textarea>
          </td>
        </tr>
      </table>

 <?  }
  if(isset($_GET['no'])) {
  echo "You cant be a member of Skyways Virtual if you don't accept all our conditions.";
  }
  if(isset($GET['show'])) {
  $show = $password;
  }
  ?>
  </tr>
</table>
</body>
</html>

Såhär blir det nu... http://www.skyvirtual.org/new-123/join.php :l

Medlem sedan maj 20002 993 inlägg
#2
// Texten i början
if (!isset($_GET['yes']) && !isset($_GET['no']))
{
 // Radioknappar
}
elseif (isset($_GET['yes']))
{
 // formuläret
}
else
{
  // No no!
}
Medlem sedan juli 20049 inlägg
#3

Tusen tack... :)

Medlem sedan juli 20049 inlägg
#4

Lite mera knep...

<?php
include "include.php";
if(isset($_POST['submit'])) {

if(empty($_POST['firstname']))
$firstname = "Not set";
if(empty($_POST['lastname']))
$lastname = "Not set";
if(empty($_POST['password']))
$password = "Not set";
if(empty($_POST['age']))
$age = "Not set";
if(empty($_POST['vatsim_id']))
$vatsim_id = "Not set";
if(empty($POST['email']))
$email = "email";
if(empty($_POST['comment']))
$comment = "Not set";

$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$password = $_POST['password'];
$age = $_POST['age'];
$vatsim_member = $_POST['vatsim_member'];
$vatsim_id = $_POST['vatsim_id'];
$password = $_POST['email'];
$email = $_POST['comment'];

$add = "INSERT INTO request (firstname, lastname, age, vatsim_id, password, email, comment) VALUES ('$firstname', '$lastname', '$age', '$vatsim_id',  '$password', '$email', '$comment')";
mysql_query($add) or die(mysql_error());
$ready = "<b>Your application has now been sent to us, It will take 1-3 day until we accepting you and in holiday times 1-2 weeks.<br> You will recive the answer in you mailbox.</b>";
}
?>
<head>
<title>Skyways VA</title>
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<html>
<body BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" onLoad="" LINK="#CE1141" VLINK="#CE1141" ALINK="#CE1141">
<table width="685" border="0" height="310">
  <tr> 
    <td valign="top"  class="table1" height="285"><b>Join</b><br>
    <br>
    Join Skyways VA is very easy, Just fill out the form below this text after 
    that you have<br>
    accepted all our conditions.<br>
    <br>
    &#149; You must be at least 13 year old.<br>
    &#149; You must have a legal copy of Microsoft Flight Simulator 2002/2004<br>
    &#149; You must have some knowledge about how to fly in MSFS.<br>
    &#149; It's very good if you have some online flying knowledge. (Read our 
    manual then you can login)<br>
    &#149; You must be capable to fly one flight in every month.<br>
    <br>
<?php
if (!isset($_GET['yes']) && !isset($_GET['no']))
{ ?>
	<form>
 <input type="radio" name="yes" value="yes" onclick="this.form.submit()" />
      I <b>accept</b> all the conditions and are 13 year old or older.<br>
<input type="radio" name="no" value="no" onclick="this.form.submit()" />
      I <b>don't</b> accept the conditions.
      </form>
<?
}
elseif (isset($_GET['yes']))
{ ?>
<form method="post" action="join.php">
      <table width="669" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="190" class="table1"><b>Firstname:</b></td>
          <td class="table1" width="166"> 
            <input type="text" name="firstname" class="falt">
          </td>
          <td class="table1" rowspan="6" valign="top" width="10">&nbsp;</td>
          <td class="table1" rowspan="8" valign="top" width="303"><img src="images/join.gif" width="198" height="147"></td>
        </tr>
        <tr> 
          <td width="190" class="table1"><b>Lastname:</b></td>
          <td class="table1" width="166"> 
            <input type="text" name="lastname" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="190" class="table1"><b>Year of birth:</b></td>
          <td class="table1" width="166">
              <select name="age" class="falt">
                <option selected>1990</option>
				<option>1989</option>
                <option>1988</option>
                <option>1987</option>
                <option>1986</option>
                <option>1985</option>
                <option>1984</option>
                <option>1983</option>
                <option>1982</option>
                <option>1981</option>
                <option>1980</option>
                <option>1979</option>
                <option>1978</option>
                <option>1977</option>
                <option>1976</option>
                <option>1975</option>
                <option>1974</option>
                <option>1973</option>
                <option>1972</option>
                <option>1971</option>
                <option>1970</option>
                <option>1969</option>
                <option>1968</option>
                <option>1967</option>
                <option>1966</option>
                <option>1965</option>
                <option>1964</option>
                <option>1963</option>
                <option>1962</option>
                <option>1961</option>
                <option>1960</option>
                <option>1959</option>
                <option>1958</option>
                <option>1957</option>
                <option>1956</option>
                <option>1955</option>
                <option>1954</option>
                <option>1953</option>
                <option>1952</option>
                <option>1951</option>
                <option>1950</option>
                <option>1949</option>
                <option>1948</option>
                <option>1947</option>
                <option>1946</option>
                <option>1945</option>
                <option>1944</option>
                <option>1943</option>
                <option>1942</option>
                <option>1941</option>
                <option>1940</option>
                <option>1939</option>
              </select>
            </td>
        </tr>
        <tr> 
          <td width="190" class="table1"><b>Password:</b></td>
          <td class="table1" width="166"> 
            <input type="password" name="password" class="falt">
            &nbsp;&nbsp;</td>
        </tr>
        <tr> 
          <td width="190" class="table1"><b>Email:</b></td>
          <td class="table1" width="166"> 
            <input type="text" name="email" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="190" class="table1"><b>Vatsim id:</b></td>
          <td class="table1" width="166"> 
            <input type="text" name="vatsim_id" class="falt">
          </td>
        </tr>
        <tr> 
          <td width="190" class="table1" height="2"><b>Short info about your self:</b></td>
          <td width="166" class="table1" height="2">&nbsp;</td>
          <td width="10" class="table1" height="2">&nbsp;</td>
        </tr>
        <tr> 
          <td width="190" class="table1" height="2"> 
            <textarea name="comment" cols="32" rows="4" class="falt"></textarea>
          </td>
          <td width="166" class="table1" height="2">&nbsp;</td>
          <td width="10" class="table1" height="2">&nbsp;</td>
        </tr>
      </table>
      <input type="submit" name="submit" value="Submit" class="submit">
      <input type="reset" name="Submit2" value="Reset" class="submit">
      
      </form><br><br>
	  <?
		  if(isset($_GET['submit'])) {
		  echo $ready;
	  }
	}
else
{
  echo "<b>You have to accept all the conditions to continue!</b>";
 ?>
      <br>
 <A href="javascript:history.back();"><b>Back &laquo;</b></A>
 <?
}
?>
      </td>
  </tr>
</table>
</body>
</html>

Jag vill att $ready skall lägga sig under submit knappen utan att formuläret försvinner. :l

280 ms totalt · 4 externa anrop · v20260731065814-full.86ec41c2
125 ms — deklarationer (db)
0 ms — hämta statistik (cache)
152 ms — hämta tråd, inlägg och bilagor (db)
124 ms — ändringar (db)